SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    epsom
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    session countdown

    Hi Guys/Girls

    Can you help?

    I would like to know if it is possible to have a session countdown so that when someone logs into my site then a countdown will appear in real time.

    I know that i can do this in asp but can a real countdown appear on the page without a refresh?

    Thanks

    Nick

  2. #2
    Original Gangster silver trophy Thing's Avatar
    Join Date
    Oct 2000
    Location
    Philadelphia, PA
    Posts
    4,708
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

  3. #3
    Afrika
    Join Date
    Jul 2004
    Location
    Nigeria
    Posts
    1,737
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Guess this thread would be better of in the Jscript section

    http://www.sitepoint.com/forums/forumdisplay.php?f=15

  4. #4
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    epsom
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well i was not sure as i wanted to use asp as well so that when the 20mins ran out then a prompt box would appear asking to extend session.

    the other problem i have is if i use javascript then how do i stop it refreshing the timer ever time a page is opened.. as i would like to use either asp or javascript on a password protected site and have the countdown on every page but at the moment if i did that it would keep on resetting?

    any ideas?

    thanks

    nicholas

  5. #5
    ALT.NET - because we need it silver trophybronze trophy dhtmlgod's Avatar
    Join Date
    Jul 2001
    Location
    Scotland
    Posts
    4,836
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The session expires 20mins AFTER the last page request, so if you refreshed the page, the timeout would reset itself back to 20mins, or whatever the timeout has been set to.

    So in theory, having a JS timed on each page would simply need to start whenever a page reloads at whatever the time out is.


  6. #6
    Afrika
    Join Date
    Jul 2004
    Location
    Nigeria
    Posts
    1,737
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I hope i do understand fully what u are trying to achieve, but here is my advice.

    A session by default, as dhtmlgod said is 20mins, you could increase it with this
    Code:
    session.timeout = 100
    Better yet, the best way to track a users, session is by the use of cookies, with a
    Code:
    response.cookie
    objects, setting the values of cookies to the users hard drive. Then whenever the user requests a page, check to see if the cookie exists and then create or extend the session based on that value

    ALSO: You really cant monitor a session countdown with a javascript, 'cause it wont be effective, the session.timeout value is set by the server and the javascript client script woudl run, once the page loads on the browser, which would have different values

    hope this helps
    Afrika


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
  •