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 Coder
    Join Date
    Dec 2003
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Are Session Expirations possible in PHP?

    I'm wondering if this is possible. I was suggested to do the following to expire a session:

    session_cache_expire(5); // expires in 5 minutes
    session_start();


    The problem is that the session does not expire. I use that for a login script and I'm still able to browse after more than a day goes by and even if the browser is closed. Is there a way to do this without changing a configuration file? I've searched other posts and the manual without luck.

    Do other web apps that use login scripts rely on setcookie or sessions? Any help is appreciated. Thanks!

  • #2
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    A session expires automatically after 26 - 30 mins if the user is idling. 5 mins is a bit short

  • #3
    New Coder
    Join Date
    Jan 2004
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This function is only available to version 4.2.0...

    Anyways it recommended you use session_cache_limiter along with it. I recommened you have a look at the users comments on that pages as IE can produce some strange results unless you configure php correctly to avoide this.

    Cheers,
    Stuart
    -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
    www.php-editors.com - PHP Editors Reviewed
    www.phphub.com - PHP Community Hub
    www.php-freelancers.com - PHP Freelance Jobs
    -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~


  •  

    Posting Permissions

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