Click to See Complete Forum and Search --> : Standard practice for redirecting user after log-in
TonyLoco23
03-11-2009, 08:16 PM
What is the standard practice for redirecting a user back to their previous page after they have logged in?
Do you just store the URL of where they were in a session variable and then use response.redirect after they succesfully log in?
That seems to me to be the most sensible way.
zahidraf
03-12-2009, 03:18 AM
Get the Ref URL in the Login Page
Ater Login, Redirect user to that page
Technology News (http://www.zahipedia.com)
TonyLoco23
03-12-2009, 07:52 AM
What?
What do you mean by "in the login page"?
Do you mean you pass it into the URL and do request.querystring?
Kuriyama
03-13-2009, 11:02 AM
There is no standard practice for this. Putting the referring URL in the session will require less validation. Just make sure that you pull that value out of the session, then remove that variable from memory and you'll be fine.
TonyLoco23
06-03-2009, 04:11 PM
Just make sure that you pull that value out of the session, then remove that variable from memory and you'll be fine.
Damn, easier said than done. Everytime I passed the session variable into a string and tried to remove it from memory, it cleared both the session variable and the string!!??
I ended up having to store the session variable string in a hidden textbox and that stopped it from being wiped.
sURLRedir2 = request("txtUrlRedir")
Session.Contents.Remove("URLRedir")
response.Redirect(sURLRedir2)
deepu8
06-05-2009, 03:26 AM
Hope this code will be helpful for you...
$page = "users/$user.html"; // replace with you page
header("Location:$page");
or, you could use a
echo "<body onload=\"window.location='$page'\">";
or
echo "<META HTTP-EQUIV=\"REFRESH\" CONTENT=\"0; URL=$page\">";
or of course you could
include("$page");