Return to Snippet

Revision: 77351
at September 14, 2019 16:30 by interviewqueries


Initial Code
You can change default session time by using below code

<?php
// server should keep session data for AT LEAST 1 hour
ini_set('session.gc_maxlifetime', 3600);

// each client should remember their session id for EXACTLY 1 hour
session_set_cookie_params(3600);
?>

Initial URL

                                

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

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

Initial Tags
php, path

Initial Language
PHP