Solved

Session_OnStart problems in Global.asa

Posted on 2006-10-24
4
293 Views
Last Modified: 2008-01-09
I am using some Ajax to check things like if the username already exists.  If a session times out, instead of getting nothing or the correct return in my <span>, I get the login page.  Also, if a user sits at the login screen for longer than the session timeout, when they go to login, it will just redirect them back to the login page.  If they then login again, it will work.  What do I do about these?

My Session_OnStart has:
  If Application("START_PAGE") <> request.servervariables("SCRIPT_NAME") or _
     Request.ServerVariables("SCRIPT_NAME") <> (Application("ROOT_DIR") & "loginverify.asp") then
    RESPONSE.REDIRECT Application("START_PAGE")
  End If

Thanks,

Traigo
0
Comment
Question by:traigo
  • 2
  • 2
4 Comments
 
LVL 58

Expert Comment

by:amit_g
ID: 17798236
That is more of a business decision that technical one. Do you want the user to never expire the session? If so you could have an image getting refreshed in Javascript or have a hidden frame getting refreshed every 5 minutes or so to keep the session alive.
0
 

Author Comment

by:traigo
ID: 17798514
I would like sessions to expire.  In the page headers, I have meta http-equiv="refresh" to logout the users at a specified interval.  The problem is both the register.asp (which uses the ajax) and the login page are not behind authentication.  So anyone could open a session by going to one of those pages.  If they just sit on the page I don't want to keep sessions alive indefinitely.  I would like to release the memory.  I guess I could use the meta http-equiv="refresh" to redirect the user back to the login page from register.asp at a specific time.  I then still have the problem with the login.asp.

0
 
LVL 58

Accepted Solution

by:
amit_g earned 500 total points
ID: 17798560
Then in login.asp let the session last as long as the page is open by using a hidden image or iframe. Once the page is closed, the session would go away in 20 minutes (or whatever is session timeout) but as long as the user keep the page open, the session would be alive. Since all other pages are protected, this is the only page that would do it and should not have much impact on the server. If that is not desirable, have this page refresh using the same technique (meta refresh) but then the user would lose if something was filled out.
0
 

Author Comment

by:traigo
ID: 17798617
Ok, I will probably just make a keepalive.asp that just returns blank and use some Ajax every so often to check that page.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question