What is the default session time in PHP and how can I
change it?

Answer Posted / rakesh kumar nautiyal

<?php
session_start();

session_cache_expire(15);
$cache_expire = session_cache_expire();

if(!isset($_SESSION['password'])){
$msg = "Your session is expired.Please re enter the
password";
header("Location: index.php?msg=".$msg);
} else {
// remaining code to display the gallery
}
?>

Is This Answer Correct ?    44 Yes 63 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between php and java?

526


Which function is used to strip whitespace?

444


How we load all classes that placed in different directory in one php file , means how to do auto load classes.

504


Why would we use === instead of ==?

8355


How many types of php frameworks are there?

490






Could we start a variable with number like $4name?

517


What is laravel php?

539


How can you increase the maximum execution time of a script in php?

521


What is member function?

567


Is PHP an open source software?

580


How can we submit from without a submit button?

580


What is csrf verification?

533


What is php simple definition?

539


How to store the uploaded file to the final location?

518


Explain what is the difference between $var and $$var?

527