Posted By

interviewqueries on 09/14/19


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
  3. <?php
  4. // server should keep session data for AT LEAST 1 hour
  5. ini_set('session.gc_maxlifetime', 3600);
  7. // each client should remember their session id for EXACTLY 1 hour
  8. ?>

Report this snippet  

You need to login to post a comment.