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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.