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?
Redirect to different site after login
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Redirect to different site after login
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: Redirect to different site after login
I got it working with this code:
string currentReferrerUrl = Request.Cookies["NRAReferrerUrl"].Value;
FormsAuthentication.SetAuthCookie(UserName.Text, false);
Response.Redirect(currentReferrerUrl);
string currentReferrerUrl = Request.Cookies["NRAReferrerUrl"].Value;
FormsAuthentication.SetAuthCookie(UserName.Text, false);
Response.Redirect(currentReferrerUrl);
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Re: Redirect to different site after login
Thanks Judy! I couldn't figure out how to login without a redirect for the life of me.
As always, I appreciate your contribution to these forums!
Scott
As always, I appreciate your contribution to these forums!
Scott
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: Redirect to different site after login
Wow, it pays to talk to myself! 

Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx