Session timeout

Results 1 to 2 of 2

Thread: Session timeout

  1. #1
    Join Date
    Dec 1969

    Default Session timeout

    Hi,<BR><BR>I have specified session timeout =20 in web.config. <BR>But when the session timeout has occured, i want the page to be redirected to the homepage, so i wrote these few lines.<BR><BR>if (Session.Timeout== 0) <BR>{<BR> Response.Redirect("Default.aspx");<BR>}<BR><BR>Do i need to add this bit of code in each page?<BR>Is there any other better way to do this. <BR>Is there any way to let the user know that the session timeout has occured and so he has been or he is going to be logged out?<BR><BR>Thanks<BR>Philip

  2. #2
    Join Date
    Dec 1969

    Default RE: Session timeout

    if (Session.Timeout== 0) <BR>{<BR>Response.Redirect("Default.aspx");<BR>}<B R><BR><BR>WRONG!!<BR><BR>Session.timeout will always equal 20, because you&#039;ve set it that way. the way to do this is to create a session variable when the user logs in, then check for it&#039;s existence in each page. if it no longer exists, the session has timed out.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts