skip to Main Content
  1. i start one session on login page.
  2. after successfully login user redirected to dashboard.
  3. so in session default time is 24 min so after that time if
    user is active then also session destroy or not?

is user login or logout?

2

Answers


  1. Yes session get’s destroyed by self after inactivity of 24 minutes.

    By default, PHP sessions expire after 1440 seconds of inactivity. This means that if a user is active, the session will not expire automatically.

    However, it’s important to note that the session timeout is based on inactivity, not activity. So if the user is actively using the application, the session will not expire even if it has been open for more than 24 minutes.

    Via php doc

    Defaults to 1440 (24 minutes). Note: If different scripts have different values of session.gc_maxlifetime but share the same place for storing the session data then the script with the minimum value will be cleaning the data.

    Login or Signup to reply.
  2. Yes session is destroyed automatically after inactivity of 24 minutes by default.

    So in your case if user is active session will not get out.

    Still if you want to increase your session inactivity time you can use:

    ini_set('session.gc_maxlifetime', 3600);
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search