Session Variables

Results 1 to 2 of 2

Thread: Session Variables

  1. #1
    Join Date
    Dec 1969

    Default Session Variables

    Does anyone know if it is possible to monitor the life of a session variable. What I am doing is setting a session variable to timeout in 2 minutes, but I want to alert the user 1 minute before the session variable times out to tell them that their shopping cart will empty if they don&#039;t do something.<BR><BR>(The reason I need to do this is that I have a shopping cart system - no credit cards involved - that will sit on a PC at a conference with free access to all. I need to end session and empty cart in case a user abandons their order half way through. If a user then comes along the session would still be live with products in the cart and cause confusion - so this is fairly important)<BR><BR>Thanks<BR><BR>Micheal

  2. #2
    Spikeh Guest

    Default RE: Session Variables

    Hmm... possibly mix the with some javascript SetTimeout? I&#039;ve not tried it myself but I&#039;m sure there will be a way - from experience I don&#039;t think there is any way to track the time left on a session... give this algorithm a go:<BR><BR>ASP:<BR><BR>session.timeout = 2<BR><BR>function to check the previous session.ID (maybe passed with a querystring?):<BR>if sessionVar = then<BR> write javascript timer set to 2 mins (session refreshes on page refresh)<BR>else<BR> display error or whatever you want to do<BR>end if<BR><BR><BR>It&#039;s just an idea, again - I&#039;d have to be there doing it to get my head round it totaly :)

Posting Permissions

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