Session cookies disappear!

Discussion in 'ASP General' started by Nicolae Fieraru, Mar 17, 2005.

  1. Hi All,

    I recently discovered that my session cookies on the web host disappear
    within 30 seconds.
    I created some very simple asp scripts (it took me a while until I
    discovered why my shopping cart acts very weird...) to check the session
    cookies.

    On one asp page I set up cookies:

    setcookie.asp
    <%
    Session("TransactionID") = 15
    Session("CustomerID") = 1
    %>

    and on

    readcookie.asp
    <%
    response.write "Session(""TransactionID"")=" & Session("TransactionID") &
    "<br>"
    response.write "Session(""CustomerID"")=" & Session("CustomerID") & "<br>"
    %>

    The same asp pages run on my XP Pro show that the session cookies don't
    expire as long as I close the browser, while on the remote web server, if I
    do a refresh on readcookie.asp after 30 seconds, they are gone.

    I run ASP on the server and all I know is that it is a Plesk server. No idea
    if it actually a Linux server or a Windows one...
    Do I have to setup expiry time or something for session cookies?
    Any information appreciated.

    Regards,
    Nicolae
     
    Nicolae Fieraru, Mar 17, 2005
    #1
    1. Advertising

  2. > The same asp pages run on my XP Pro show that the session cookies don't
    > expire as long as I close the browser, while on the remote web server, if I
    > do a refresh on readcookie.asp after 30 seconds, they are gone.


    http://www.aspfaq.com/2157

    > I run ASP on the server and all I know is that it is a Plesk server. No idea
    > if it actually a Linux server or a Windows one...


    Well, that's a big difference. You're going to need to find out if it is
    Windows, and if not, what kind of ASP emulator is running. It could be a
    setting in the web server (e.g. they could have disabled session state), but
    for anything on the server, if you don't have direct access to it, you're
    going to have to talk to the technical people there anyway.

    A
     
    Aaron [SQL Server MVP], Mar 17, 2005
    #2
    1. Advertising

  3. "Aaron [SQL Server MVP]" <> wrote in message
    news:BE5E6786.38E7%...
    >> The same asp pages run on my XP Pro show that the session cookies don't
    >> expire as long as I close the browser, while on the remote web server, if
    >> I
    >> do a refresh on readcookie.asp after 30 seconds, they are gone.

    >
    > http://www.aspfaq.com/2157
    >
    >> I run ASP on the server and all I know is that it is a Plesk server. No
    >> idea
    >> if it actually a Linux server or a Windows one...

    >
    > Well, that's a big difference. You're going to need to find out if it is
    > Windows, and if not, what kind of ASP emulator is running. It could be a
    > setting in the web server (e.g. they could have disabled session state),
    > but
    > for anything on the server, if you don't have direct access to it, you're
    > going to have to talk to the technical people there anyway.
    >


    Thank you very much, Aaron. I read the FAQ and I think it is a problem on
    the web server. Apparently they have a Windows server.
    I contacted them, waiting for their reply.

    Regards,
    Nicolae
     
    Nicolae Fieraru, Mar 17, 2005
    #3
  4. Nicolae Fieraru

    Mark Schupp Guest

    "Nicolae Fieraru" <> wrote in message
    news:%...
    >
    > "Aaron [SQL Server MVP]" <> wrote in message
    > news:BE5E6786.38E7%...
    >>> The same asp pages run on my XP Pro show that the session cookies don't
    >>> expire as long as I close the browser, while on the remote web server,
    >>> if I
    >>> do a refresh on readcookie.asp after 30 seconds, they are gone.

    >>
    >> http://www.aspfaq.com/2157
    >>
    >>> I run ASP on the server and all I know is that it is a Plesk server. No
    >>> idea
    >>> if it actually a Linux server or a Windows one...

    >>
    >> Well, that's a big difference. You're going to need to find out if it is
    >> Windows, and if not, what kind of ASP emulator is running. It could be a
    >> setting in the web server (e.g. they could have disabled session state),
    >> but
    >> for anything on the server, if you don't have direct access to it, you're
    >> going to have to talk to the technical people there anyway.
    >>

    >
    > Thank you very much, Aaron. I read the FAQ and I think it is a problem on
    > the web server. Apparently they have a Windows server.
    > I contacted them, waiting for their reply.
    >
    > Regards,
    > Nicolae
    >


    Try this:

    Response.write Session.Timeout

    What do you get?

    --
    --Mark Schupp
    Head of Development
    Integrity eLearning
    www.ielearning.com
     
    Mark Schupp, Mar 17, 2005
    #4
  5. Nicolae Fieraru

    Adam Short Guest

    If this is a random occurrance, you're not alone.

    I think I have found the solution though. If the server is a Windows
    server, which I suspect it is, the name of the server must not contain any
    _.

    Micorsoft IIS6 randomly drops sessions by design if an underscore _ is
    contained in the server name, some sort of security flaw or something. To
    fix the problem make sure the machine name does not have an _ and make sure
    the workgroup it belongs to does not have an _.

    I recently experienced this problem on a new server I am renting and changed
    the workgroup as stated above and it seems to be stable.

    Try it and see

    "Nicolae Fieraru" <> wrote in message
    news:4238fa1d$...
    > Hi All,
    >
    > I recently discovered that my session cookies on the web host disappear
    > within 30 seconds.
    > I created some very simple asp scripts (it took me a while until I
    > discovered why my shopping cart acts very weird...) to check the session
    > cookies.
    >
    > On one asp page I set up cookies:
    >
    > setcookie.asp
    > <%
    > Session("TransactionID") = 15
    > Session("CustomerID") = 1
    > %>
    >
    > and on
    >
    > readcookie.asp
    > <%
    > response.write "Session(""TransactionID"")=" & Session("TransactionID") &
    > "<br>"
    > response.write "Session(""CustomerID"")=" & Session("CustomerID") & "<br>"
    > %>
    >
    > The same asp pages run on my XP Pro show that the session cookies don't
    > expire as long as I close the browser, while on the remote web server, if
    > I do a refresh on readcookie.asp after 30 seconds, they are gone.
    >
    > I run ASP on the server and all I know is that it is a Plesk server. No
    > idea if it actually a Linux server or a Windows one...
    > Do I have to setup expiry time or something for session cookies?
    > Any information appreciated.
    >
    > Regards,
    > Nicolae
    >
     
    Adam Short, Mar 17, 2005
    #5
  6. Nicolae Fieraru

    Adam Short Guest

    If this is a random occurrance, you're not alone.

    I think I have found the solution though. If the server is a Windows
    server, which I suspect it is, the name of the server must not contain any
    _.

    Micorsoft IIS6 randomly drops sessions by design if an underscore _ is
    contained in the server name, some sort of security flaw or something. To
    fix the problem make sure the machine name does not have an _ and make sure
    the workgroup it belongs to does not have an _.

    I recently experienced this problem on a new server I am renting and changed
    the workgroup as stated above and it seems to be stable.

    Try it and see

    "Nicolae Fieraru" <> wrote in message
    news:4238fa1d$...
    > Hi All,
    >
    > I recently discovered that my session cookies on the web host disappear
    > within 30 seconds.
    > I created some very simple asp scripts (it took me a while until I
    > discovered why my shopping cart acts very weird...) to check the session
    > cookies.
    >
    > On one asp page I set up cookies:
    >
    > setcookie.asp
    > <%
    > Session("TransactionID") = 15
    > Session("CustomerID") = 1
    > %>
    >
    > and on
    >
    > readcookie.asp
    > <%
    > response.write "Session(""TransactionID"")=" & Session("TransactionID") &
    > "<br>"
    > response.write "Session(""CustomerID"")=" & Session("CustomerID") & "<br>"
    > %>
    >
    > The same asp pages run on my XP Pro show that the session cookies don't
    > expire as long as I close the browser, while on the remote web server, if
    > I do a refresh on readcookie.asp after 30 seconds, they are gone.
    >
    > I run ASP on the server and all I know is that it is a Plesk server. No
    > idea if it actually a Linux server or a Windows one...
    > Do I have to setup expiry time or something for session cookies?
    > Any information appreciated.
    >
    > Regards,
    > Nicolae
    >
     
    Adam Short, Mar 17, 2005
    #6
  7. Nicolae Fieraru

    Mark Schupp Guest

    It is not IIS it is IE that is dropping cookies and it is by design.

    http://support.microsoft.com/default.aspx?scid=kb;en-us;316112

    --
    --Mark Schupp
    Head of Development
    Integrity eLearning
    www.ielearning.com


    "Adam Short" <> wrote in message
    news:%...
    > If this is a random occurrance, you're not alone.
    >
    > I think I have found the solution though. If the server is a Windows
    > server, which I suspect it is, the name of the server must not contain any
    > _.
    >
    > Micorsoft IIS6 randomly drops sessions by design if an underscore _ is
    > contained in the server name, some sort of security flaw or something. To
    > fix the problem make sure the machine name does not have an _ and make
    > sure
    > the workgroup it belongs to does not have an _.
    >
    > I recently experienced this problem on a new server I am renting and
    > changed
    > the workgroup as stated above and it seems to be stable.
    >
    > Try it and see
    >
    > "Nicolae Fieraru" <> wrote in message
    > news:4238fa1d$...
    >> Hi All,
    >>
    >> I recently discovered that my session cookies on the web host disappear
    >> within 30 seconds.
    >> I created some very simple asp scripts (it took me a while until I
    >> discovered why my shopping cart acts very weird...) to check the session
    >> cookies.
    >>
    >> On one asp page I set up cookies:
    >>
    >> setcookie.asp
    >> <%
    >> Session("TransactionID") = 15
    >> Session("CustomerID") = 1
    >> %>
    >>
    >> and on
    >>
    >> readcookie.asp
    >> <%
    >> response.write "Session(""TransactionID"")=" & Session("TransactionID") &
    >> "<br>"
    >> response.write "Session(""CustomerID"")=" & Session("CustomerID") &
    >> "<br>"
    >> %>
    >>
    >> The same asp pages run on my XP Pro show that the session cookies don't
    >> expire as long as I close the browser, while on the remote web server, if
    >> I do a refresh on readcookie.asp after 30 seconds, they are gone.
    >>
    >> I run ASP on the server and all I know is that it is a Plesk server. No
    >> idea if it actually a Linux server or a Windows one...
    >> Do I have to setup expiry time or something for session cookies?
    >> Any information appreciated.
    >>
    >> Regards,
    >> Nicolae
    >>

    >
    >
     
    Mark Schupp, Mar 18, 2005
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peter Row
    Replies:
    1
    Views:
    695
    vMike
    Nov 26, 2003
  2. PJ
    Replies:
    4
    Views:
    635
  3. Anavim
    Replies:
    2
    Views:
    382
    gerry
    Dec 26, 2004
  4. Andy Fish
    Replies:
    3
    Views:
    6,558
    Fredrik Lindner
    Nov 6, 2003
  5. _Who
    Replies:
    7
    Views:
    2,722
Loading...

Share This Page