Page 1 of 1

code fro session expire

Posted: Thu Feb 11, 2010 1:50 am
by rrn
i have got a login page with emAIL and password ..
can anyone suggest me a way to implement code for session to expire after 15 min when a peron is logged into the site if he is logged in for more than 15 min..

these are the two sessions in log in page .
$_SESSION['email']
$_SESSION['password']

below given is the code for log out page .

Code: Select all

<?php
 
session_start();
session_unregister('email');
session_unregister('password');
session_destroy();
?>
thank you... any help will be appreciated . . .

Re: code fro session expire

Posted: Thu Feb 11, 2010 4:43 am
by klevis miho

Re: code fro session expire

Posted: Thu Feb 11, 2010 4:48 am
by pbs
Use ini_set("session.gc_maxlifetime","900");

Re: code for session expire

Posted: Sun Feb 14, 2010 12:27 am
by rrn
what i want to do is , after logging in with username and password , user will be in a page ,, if he / she remains logged in for 15 min , i want it to be automatically logged out and come backk to main page ...

tried the above code , not working..