Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Jan 2004
    Location
    Minnesota
    Posts
    86
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Quick question about session variables

    I have a session variable that I set on my login page (valid_login=true) then I check on load of all my other pages to see if valid_login is true, if it's true I contine to load page, other wise I send them to the login page.

    I have noticed during testing and codeing if there is some time between activity (page changes what ever) on my test PC that it will send me back to the login page when I finaly get around to changing/refreshing the page (IE: bring up a page on test PC then go do some coding on work PC for 10-20 min or so then go back to test PC click on home button and it will send me to login page, and yes my home button normaly works just fine ).
    So I was wondering:

    - Can/Do session variables time out?
    - What the default is?
    - Can you change the default & how?


    Thanks
    J.C.
    To learn is a good thing and today I hope to learn something new!!

  • #2
    Senior Coder Morgoth's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada Remaining Brain Cells: 6
    Posts
    1,402
    Thanks
    2
    Thanked 1 Time in 1 Post
    When does a Session End?
    A session ends if a user has not requested or refreshed a page in the application for a specified period. By default, this is 20 minutes.

    If you want to set a timeout interval that is shorter or longer than the default, you can set the Timeout property.

    The example below sets a timeout interval of 5 minutes:
    Code:
    <%
    Session.Timeout=5
    %>
    To end a session immediately, you may use the Abandon method:
    Code:
    <%
    Session.Abandon
    %>
    Compliments of W3Schools.com

  • #3
    New Coder
    Join Date
    Jan 2004
    Location
    Minnesota
    Posts
    86
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks Morgoth

    J.C
    To learn is a good thing and today I have learned something new!!

  • #4
    Senior Coder Morgoth's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada Remaining Brain Cells: 6
    Posts
    1,402
    Thanks
    2
    Thanked 1 Time in 1 Post
    No problem man.
    And W3Schools is a great source for ASP help, along with a few other languages.


  •  

    Posting Permissions

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