Session time out

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mansoorsheraz
    New Member
    • Sep 2006
    • 2

    Session time out

    Hi i am, developing a new project for a calling card company. I am, having problems in the session time out. I want to redirect a user to the login page when the session time out expires. All of the pages have session_start() in them to see if the user has actually logged in to the site. I set the session.cookie_ lifetime on my login page to 60 seconds and when i click on some url after 60 seconds it takes me to the login page which is very much i want. but the problem is when i click a link before 60 seconds (say at 45 seconds) and then click on some other link and so on it never re-directs me to the login page. If i set the session.cookie_ lifetime on every page then it works fine. If the total time for a session is 5 minutes then the above solution means 5 minutes for one page.. i am, confused and not getting a clue as to how to solve this problem. Is there any way the user can be redirected to the login page when the overall session time expires irrespective of the number of pages the user is visiting? is there any relationship between session_start() and the session.cookie_ lifetime .. ?? please respond !!!
    Regards.
  • bevort
    New Member
    • Jul 2006
    • 53

    #2
    How do you set the livetime?

    session_set_coo kie_params ( int lifetime [, string path [, string domain [, bool secure [, bool httponly]]]] )

    Normaly each time you "use" your browser to submit a link to another page this Session_lifetiv e starts over

    If you want the complete session to be killed after say 10 minutes use
    setcookie ( string name [, string value [, int expire [, string path [, string domain [, bool secure [, bool httponly]]]]]] )
    and replace expire with your system-date plus the 10 minutes. Keep inmind that your date and time an not alwasy the users date and time. I did not test this effect on timing out a session

    Comment

    Working...