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
  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


RSS Icon Subscribe to comments

You need to login to post a comment.