Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jul 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Auto Session timeout

    Hi there,

    Please does any one know how to add auto session timeout code to a small multi-user CRUD database application? I purchased a PHP script and I need more security for it

    Thank you

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    3,763
    Thanks
    23
    Thanked 548 Times in 547 Posts
    I believe the timeout value is controlled by the server, but you should know that a simple javascript can keep a session going for as long as the user likes.
    Evolution - The non-random survival of random variants.

  • #3
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    What you can do is store the time of each page load in a $_SESSION var and then check it when you load the next page. If the time is too long, log the user out. This will not log them out after a given period of time, but it will disallow them from carrying out an action, as when they request the next page, they will be logged out.

    HTH
    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •