PHP session lifetime problem

后端 未结 4 391
灰色年华
灰色年华 2020-12-12 03:09

I\'m using PHP5 here. I have made a login system that check\'s the username and password against the records in the database. I want to use sessions to store the logged valu

4条回答
  •  暖寄归人
    2020-12-12 03:49

    Instead of setting it to one, why don't you set $_SESSION['logged_time'] = time(); and then check the time against time() in your application?

    If you'd like to actually expire the entire session, the exact specifics can change depending on your session handler, but for the default session handler (and any other well behaved session handler) you'll want to check out http://us3.php.net/manual/en/session.configuration.php

提交回复
热议问题