SitePoint Sponsor

User Tag List

Results 1 to 14 of 14
  1. #1
    SitePoint Zealot
    Join Date
    Apr 2010
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    session.timeout issue

    Hi guys
    I have a log in script that sets a number of session variables. I want to extend the session time to 60 mins and have added session.timeout=60 to the top of the login script.

    The user is logged in ok and the session variables are set but the session is still timing out after the default 20 mins.

    I have also tried setting the session time in IIS to 60 mins. Still it times out after 20 mins.

    If I put Response.write(session.timeout) on any of the pages in the application it displays as 60.

    SO why is it still timing out at 20 mins? Any ideas?

    Thanks

  2. #2
    SitePoint Guru
    Join Date
    Jun 2007
    Posts
    690
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmmm...

    You will need to supply some additional information. Apparently everything has been configured but is not working.

    How do you test it is timing out in 20 minutes ?

  3. #3
    SitePoint Member
    Join Date
    Jan 2010
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    looks like your code somewhere overwriting the session timeout. you may want to scan the whole project for session time out variable.

  4. #4
    SitePoint Wizard bronze trophy
    Join Date
    Oct 2001
    Location
    Vancouver BC Canada
    Posts
    2,030
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Is there a global.asa script in the root of your application? If so, it may be affecting the session.timeout
    Andrew Wasson | www.lunadesign.org
    Principal / Internet Development

  5. #5
    SitePoint Zealot
    Join Date
    Apr 2010
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by webber123456 View Post
    hmmm...

    You will need to supply some additional information. Apparently everything has been configured but is not working.

    How do you test it is timing out in 20 minutes ?
    If I log in and then leave it alone for say 25 mins and then try to navigate to another page that checks for the session variables set at the login I get my not-logged-in error message that says "you need to be logged in to see this page". I've tried leaving it for different lengths of time and it times out after 20 mins.

  6. #6
    SitePoint Zealot
    Join Date
    Apr 2010
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by awasson View Post
    Is there a global.asa script in the root of your application? If so, it may be affecting the session.timeout
    Good suggestion, but no. No global.asa.

  7. #7
    SitePoint Zealot
    Join Date
    Apr 2010
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Maryjohnisl View Post
    looks like your code somewhere overwriting the session timeout. you may want to scan the whole project for session time out variable.
    Thanks. I don't think there is anything in the code but I'll go through everything again and look for the session timeout variable just to make sure. I feel sure *something* is over-writing it but I can't see what.

    The site is hosted on a Windows VPS - could there be something at the main node level that is over-writing the settings I am putting into IIS at the next level down?

    Jackie

  8. #8
    SitePoint Guru
    Join Date
    Jun 2007
    Posts
    690
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  9. #9
    SitePoint Zealot
    Join Date
    Apr 2010
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by webber123456 View Post
    Thanks for this - looks like a useful collection of things to check

    JAckie

  10. #10
    SitePoint Enthusiast
    Join Date
    Nov 2010
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Server.TimeOut

  11. #11
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,191
    Mentioned
    191 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by faca5 View Post
    Server.TimeOut
    Could you please be a bit more helpful?

    eg. How can I check to see if that's the problem? How can I fix things if that's the problem?

  12. #12
    SitePoint Enthusiast
    Join Date
    Nov 2010
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello.

    ASP have 2 timeout.
    1 server timeout
    2 client or session timeout

    Session timeout (login timeout)
    <%
    Session.Timeout=20
    Response.Write Session.Timeout
    %>

    Server timeout (server script timeout)
    <%
    Server.ScriptTimeout=20
    Response.Write Server.ScriptTimeout
    %>

  13. #13
    SitePoint Enthusiast
    Join Date
    Nov 2010
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Aham. If session drop less then 20 min meybe your conection is not stable. In this case use cookie!

    Example:
    client connect to server - create session
    if client drop connecton to server for 1 sec - session droped

    If your website host in another country (distance) meybe can happen.


    Another you can check how many process per user do you have. Default is 1, if you have more then one then can user change process when navigate the site. In this case session will drop. For login is good to have cookie.

  14. #14
    SitePoint Wizard siteguru's Avatar
    Join Date
    Oct 2002
    Location
    Scotland
    Posts
    3,629
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Is this site running on a load-balanced server? (Sessions issues are not unheard-of in such an environment).
    Ian Anderson
    www.siteguru.co.uk


Bookmarks

Posting Permissions

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