Facebook has modified their authentication mechanism recently by adding this #= characters to the end of their response. The # symbol at the end of the string is actually creating the problem. So you can either truncate the query and do the redirect which will work fine.