redirect when session timeout

hi all members,

I want to redirect my application to my login page is user session is expired.
Is any setting in web.config or globa.asa to perform this, i dont want to put session chk in all the pages.

Please help me ASAP

Thanks & regards

Vipin Yadav




Answer this question

redirect when session timeout

  • Empy

    Just mark you authenticaion timeout be the same or little less than the session timeout and it should just work automatically.

    <authentication mode="Forms">
    <forms name="LoginAuth" timeout="30" loginUrl="Login.aspx"
    protection="All" path="/" />
    </authentication>



  • RRV

    well you can add a session using Session.Add()

    then you can check for a session using Session["sessionName"] and see if it returns null and if it does just redirect them using Response.Redirect("login.aspx");



  • redirect when session timeout