Redirect to different site after login
Posted: Mon Aug 10, 2009 2:39 pm
I am having to do a redirect to the referring Url from the login button on the login page. I've got it picking up the referrer Url (not a store page) and they want the customer redirected back to that page after login. I can't use the default code below because the url might not be a store url, it might be just an html url.
Instead of
FormsAuthentication.RedirectFromLoginPage(UserName.Text, false); //doesn't work because url is from outside
I'm using
string currentReferrerUrl = Request.Cookies["NRAReferrerUrl"].Value;//custom cookie
Response.Redirect(currentReferrerUrl);
and it does the redirect fine, but it doesn't log them in before the redirect.
How can I automatically log them in?
Instead of
FormsAuthentication.RedirectFromLoginPage(UserName.Text, false); //doesn't work because url is from outside
I'm using
string currentReferrerUrl = Request.Cookies["NRAReferrerUrl"].Value;//custom cookie
Response.Redirect(currentReferrerUrl);
and it does the redirect fine, but it doesn't log them in before the redirect.
How can I automatically log them in?