Catch session expiry

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Stryks
Forum Regular
Posts: 746
Joined: Wed Jan 14, 2004 5:06 pm

Catch session expiry

Post by Stryks »

Hey all,

Just wondering what the best way would be to catch an expired session and differentiate it from a new visitor.

What I mean is, I have a user who is logged in and they have some information stored in a session. If they sit on the same page for more than 15 minutes or so, the session will expire and the information is lost.

At this stage they are just ejected out to the base page with an error that they do not have sufficient auth to view the page they requested (to stop unauthorised users just guessing filenames till they find the admin pages).

What I would like is if their session expired, they were told that their session expired, instead of that they dont have authorisation.

Any suggestions.
Post Reply