Detect when the session is going to time out and display some kind of message.

Discussion in 'ASP .Net' started by UJ, Aug 11, 2005.

  1. UJ

    UJ Guest

    How do you detect when your session is going to timeout and display a
    message saying 'unless you do something you will be logged out' much the way
    bank web pages do?

    Can you do it for the site or do you need to put code on every page doing
    it?

    TIA
    UJ, Aug 11, 2005
    #1
    1. Advertising

  2. UJ

    Curt_C [MVP] Guest

    Re: Detect when the session is going to time out and display somekind of message.

    UJ wrote:
    > How do you detect when your session is going to timeout and display a
    > message saying 'unless you do something you will be logged out' much the way
    > bank web pages do?
    >
    > Can you do it for the site or do you need to put code on every page doing
    > it?
    >
    > TIA
    >
    >


    Nope...you could toss a timer on the page and do it yourself, but you
    can't poll the session timer, without restarting it...


    --
    Curt Christianson
    site: http://www.darkfalz.com
    blog: http://blog.darkfalz.com
    Curt_C [MVP], Aug 11, 2005
    #2
    1. Advertising

  3. UJ

    Lucas Tam Guest

    "UJ" <> wrote in
    news:eVDZ#:

    > How do you detect when your session is going to timeout and display a
    > message saying 'unless you do something you will be logged out' much
    > the way bank web pages do?
    >


    You could put a javascript timer on the page to detect idleness.

    Or if you're using SQL server as your state server, you could poll a web
    service using client javascript to get a more accurate time. Just make sure
    the web service is running under a different app than your ASP.NET
    application, otherwise the session timer will get reset on each request.



    --
    Lucas Tam ()
    Please delete "REMOVE" from the e-mail address when replying.
    http://members.ebay.com/aboutme/coolspot18/
    Lucas Tam, Aug 11, 2005
    #3
  4. UJ

    UJ Guest

    Thanks Lucas. That's what I ended up having to do.

    "Lucas Tam" <> wrote in message
    news:Xns96AF783A6FFC0nntprogerscom@127.0.0.1...
    > "UJ" <> wrote in
    > news:eVDZ#:
    >
    >> How do you detect when your session is going to timeout and display a
    >> message saying 'unless you do something you will be logged out' much
    >> the way bank web pages do?
    >>

    >
    > You could put a javascript timer on the page to detect idleness.
    >
    > Or if you're using SQL server as your state server, you could poll a web
    > service using client javascript to get a more accurate time. Just make
    > sure
    > the web service is running under a different app than your ASP.NET
    > application, otherwise the session timer will get reset on each request.
    >
    >
    >
    > --
    > Lucas Tam ()
    > Please delete "REMOVE" from the e-mail address when replying.
    > http://members.ebay.com/aboutme/coolspot18/
    UJ, Aug 12, 2005
    #4
    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. jakk
    Replies:
    2
    Views:
    770
  2. sunkrajesh
    Replies:
    0
    Views:
    347
    sunkrajesh
    May 31, 2009
  3. Tony Johansson
    Replies:
    3
    Views:
    1,364
    Abdul Sami
    Dec 30, 2009
  4. Jazzis
    Replies:
    2
    Views:
    233
    Jazzis
    Sep 23, 2003
  5. J
    Replies:
    2
    Views:
    669
Loading...

Share This Page