preventing session variables from going null

Discussion in 'ASP General' started by javelin, Dec 18, 2006.

  1. javelin

    javelin Guest

    In ASP classic pages, I want to know if it's possible to prevent
    session variables from becoming zero length strings? I have tried
    setting the Session.Timeout to a large value, but alwas, after 20
    minutes, my session variable times out. I also tried setting the
    session timeout in IIS manager to a high value, but this did no good
    either.

    I just want to allow one particular session variable to last a long
    time. Any other suggestions? \

    Thanks.
     
    javelin, Dec 18, 2006
    #1
    1. Advertising

  2. javelin

    Mike Brind Guest

    "javelin" <> wrote in message
    news:...
    > In ASP classic pages, I want to know if it's possible to prevent
    > session variables from becoming zero length strings? I have tried
    > setting the Session.Timeout to a large value, but alwas, after 20
    > minutes, my session variable times out. I also tried setting the
    > session timeout in IIS manager to a high value, but this did no good
    > either.
    >
    > I just want to allow one particular session variable to last a long
    > time. Any other suggestions? \
    >


    Session Variables live as long as the session (unless you explicitly
    terminate them before that). If you want a value to persist beyond the life
    of a session, then by definition, this can't be done using a session
    variable. You will need to use a different mechanism - database/text
    file/application variable...

    --
    Mike Brind
     
    Mike Brind, Dec 18, 2006
    #2
    1. Advertising

  3. javelin

    Evertjan. Guest

    Mike Brind wrote on 18 dec 2006 in
    microsoft.public.inetserver.asp.general:

    >
    > "javelin" <> wrote in message
    > news:...
    >> In ASP classic pages, I want to know if it's possible to prevent
    >> session variables from becoming zero length strings? I have tried
    >> setting the Session.Timeout to a large value, but alwas, after 20
    >> minutes, my session variable times out. I also tried setting the
    >> session timeout in IIS manager to a high value, but this did no good
    >> either.
    >>
    >> I just want to allow one particular session variable to last a long
    >> time. Any other suggestions? \
    >>

    >
    > Session Variables live as long as the session (unless you explicitly
    > terminate them before that). If you want a value to persist beyond
    > the life of a session, then by definition, this can't be done using a
    > session variable. You will need to use a different mechanism -
    > database/text file/application variable...


    In other words:

    Session variables never time out,
    they just fade away ...

    .... when the session ends.



    Preventing the session from ending is all that is required.


    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
     
    Evertjan., Dec 18, 2006
    #3
  4. "javelin" <> wrote in message
    news:...
    > In ASP classic pages, I want to know if it's possible to prevent
    > session variables from becoming zero length strings? I have tried
    > setting the Session.Timeout to a large value, but alwas, after 20
    > minutes, my session variable times out. I also tried setting the
    > session timeout in IIS manager to a high value, but this did no good
    > either.
    >
    > I just want to allow one particular session variable to last a long
    > time. Any other suggestions? \


    That's strange. Session variables should survive for at least the period
    specified as the session timeout in IIS Manager.

    Is this Win2K3 IIS6? If so do you have periodic recycling enabled on the
    application pool your ASP app belongs to?

    You are aware that if you close your browser you are no longer able to
    access the session, right?


    >
    > Thanks.
    >
     
    Anthony Jones, Dec 19, 2006
    #4
  5. javelin

    javelin Guest

    I'm aware of how session variables work, but can't figure out why the
    session timeout settings are being ignored. I can't find anything in
    the code (300+ pages worth) that would explain why this particular
    variable gets set to "", but there is got that checks if the value is
    set to "", and if so, it closes the browser.

    I know the server is Windows Server 2003, SP1, if that helps.

    Thanks.

    Anthony Jones wrote:
    > "javelin" <> wrote in message
    > news:...
    > > In ASP classic pages, I want to know if it's possible to prevent
    > > session variables from becoming zero length strings? I have tried
    > > setting the Session.Timeout to a large value, but alwas, after 20
    > > minutes, my session variable times out. I also tried setting the
    > > session timeout in IIS manager to a high value, but this did no good
    > > either.
    > >
    > > I just want to allow one particular session variable to last a long
    > > time. Any other suggestions? \

    >
    > That's strange. Session variables should survive for at least the period
    > specified as the session timeout in IIS Manager.
    >
    > Is this Win2K3 IIS6? If so do you have periodic recycling enabled on the
    > application pool your ASP app belongs to?
    >
    > You are aware that if you close your browser you are no longer able to
    > access the session, right?
    >
    >
    > >
    > > Thanks.
    > >
     
    javelin, Dec 19, 2006
    #5
  6. "javelin" <> wrote in message
    news:...
    > I'm aware of how session variables work, but can't figure out why the
    > session timeout settings are being ignored. I can't find anything in
    > the code (300+ pages worth) that would explain why this particular
    > variable gets set to ""


    Is it really getting set to "" or is in fact Empty (test using IsEmpty
    function)?
    'why this particular variable gets set to ""' suggest that you have other
    session variables that survive longer, is that so?
     
    Anthony Jones, Dec 19, 2006
    #6
    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. Abraham Luna

    session variables end up null

    Abraham Luna, Sep 8, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    621
    Abraham Luna
    Sep 9, 2005
  2. Replies:
    5
    Views:
    26,698
    Mike Schilling
    Mar 29, 2006
  3. Replies:
    2
    Views:
    969
  4. Lord0
    Replies:
    4
    Views:
    394
    Arne Vajhøj
    Mar 4, 2009
  5. Replies:
    9
    Views:
    94
    -berlin.de
    Sep 19, 2006
Loading...

Share This Page