PDA

View Full Version : 404 after session expires


codefox
03-16-2003, 10:04 AM
I have a site with session timeout set to 20 mins. After the session expires, if I try clicking a link to a page in the site I get a 404 error. But when I refresh the page it works fine. Actually, when I click the link after the session expires, i see a message in the status bar saying the browser tries to load the default.asp page in that directory. What exactly could be the reason and how do I overcome it?

Thanks.

arnyinc
03-17-2003, 05:38 PM
Do you use the session for navigation and deciding where the user goes? After the session expires, it doesn't know where to point the user since your session variable is blank, so it just sends them to the root file in that directory.

That's the best guess I can make without any information about what the session variable is used for.

raf
03-17-2003, 06:48 PM
Just thinking;

do you have some code in your session_onend sub in your global.asa? If so, Can we see it ?

You can redirect there automatically (so when the session times out, the user is redirected to a certain page (with some kind a message) when the next request from that server turns up on your server. (I alway integrate it with my other security so there nothing about that in my global.asa)

About your problem: whats a 404 errormessage ("File not found"?)? It's not an asp errorcode so it probably is not session or asp related. My geuss is you have a redirect in your session_on end that points to a non-existing file or that the server tryes to load the default.asp file by default.

Refreshing it will probably just reload the page from the browsercache (so no browser interaction).

Fixes:
- set up a default.asp page and store it in the root of your virtual directory. In this default.asp page, you can redirect to your startpage, or show a timout-message with a link to the startpage.
- put a redirect in your session_onend sub.

codefox
03-19-2003, 08:57 AM
Thanks for the replies. I'd given a response.redirect. Since it was buried deep into the code I overlooked it.