What is default session time and path in PHP. How to change it ?


/ Published in: PHP
Save to your folder(s)

Default session time in PHP is 1440 seconds (24 minutes) and the Default session storage path is temporary folder/tmp on server.


Copy this code and paste it in your HTML
  1. You can change default session time by using below code
  2.  
  3. <?php
  4. // server should keep session data for AT LEAST 1 hour
  5. ini_set('session.gc_maxlifetime', 3600);
  6.  
  7. // each client should remember their session id for EXACTLY 1 hour
  8. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.