View Single Post
  #3 (permalink)  
Old 11-06-09, 10:14 AM
jonnekke jonnekke is offline
Code Guru
 
Join Date: Oct 2005
Location: holland!
Posts: 704
Thanks: 0
Thanked 0 Times in 0 Posts
is it also possible to get the remaining lifetime of a session?

I set it to:
PHP Code:


session_cache_expire
(15);
session_start();

if(!isset(
$_SESSION['user'])){
    
$uniek_sec date("U");
    
$uniek_ip $_SERVER['REMOTE_ADDR'];
    
    
$uniek md5(uniqid(microtime()) . $_SERVER['REMOTE_ADDR'] . $_SERVER['HTTP_USER_AGENT']);    
    
    
$_SESSION['user']  = $uniek;
    
} else {

echo
"session still running";



This should create a session with the name "user" that lasts for 15 min.
And then if the session exists it should echo the "session still running"
message.

If not it should create the user session as written above..

This is the way to do this?.

I noticed also that a session is not expired after 15 min.

_j

Last edited by jonnekke; 11-06-09 at 10:41 AM.
Reply With Quote