Link to home
Start Free TrialLog in
Avatar of Moiz Saifuddin
Moiz Saifuddin

asked on

Redirect a User when the Session Expires

Guys, I need to Redirect a User when the Session Expires to the Login Page,
Only when the session timesout or expires......the user is directed back to the Login Page

Simple as it seems in theory, its not in real, I need help


Avatar of appari
appari
Flag of India image

if suppose your Login Username is saved in a session variable UserName then check it like this

if session("UserName")="" then
     response.redirect("loginpage")
end if

add this at the beginning of the page.
Avatar of qwertykeyboard
qwertykeyboard

That probly wouldnt work would it, because surly you will always have a session, but you will have different values. How about tring that, but replacing the

if session("UserName")="" then

with

if session("UserName")="0 then

This would however rely on you creating a session with a value of "1" once they have logged in
ASKER CERTIFIED SOLUTION
Avatar of appari
appari
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial