Posted By

interviewqueries on 09/14/19


Tagged

php session time path default in


Versions (?)

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


 / Published in: PHP
 

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

  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  

You need to login to post a comment.