Session Time Out Settings Using PHP

User avatar
admin
Site Admin
Posts: 35
Joined: Sun Jul 03, 2016 2:17 pm
Location: India
Contact:

Session Time Out Settings Using PHP

Postby admin » Sun Jul 03, 2016 5:03 pm

In order to set session timed out limit in PHP file one can use below mentioned code:

Code: Select all

<?php
session_start();

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

if(!isset($_SESSION['password']))
{
$msg = "Your session is expired...Please login again";
header("Location: index.php?msg=".$msg);

}
?>


Have a nice day
Finest web hosting solution at the most affordable rates
Cheap Website Hosting
cheap VPS hosting india

Return to “Scripts / Code Snippets”

Who is online

Users browsing this forum: No registered users and 0 guests