Jump to content

Detect ended session


sphinx9999

Recommended Posts

I have a standard login page. If a user leaves the page for a while and then comes back they try and browse and are redirected to this page. This is confusing them ???. When a user's session expires I need to tell them that they have been logged out due to inactivity for n minutes. However, I do not want to put this on the page before they have logged in. What is left of a session when it expires? Is it completely destroyed by PHP? Is there any way of making a distinction between a session that was never created and one which has expired?

 

My session looks something like this:

 

Array
(
    [user_id] => 99999999
    [permission] => 45
)

 

Thanx

Link to comment
https://forums.phpfreaks.com/topic/78911-detect-ended-session/
Share on other sites

Is there any way of making a distinction between a session that was never created and one which has expired?[/quote]

Not easily. There are a few custom session handling classes around and even tutorials on the subject if you google. These classes usually store session values in a database. this gives you alot more control over what can and can't be done with sessions.

Its really not something that can be explained in a simple forum post. google for [i]custom php session class[/i] or something simular and you might find an article on the subject.

Link to comment
https://forums.phpfreaks.com/topic/78911-detect-ended-session/#findComment-399359
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.