Sessions and LDAP

erikkangaroo

New Member
I have a webpage. The authentication to the webpage is handled by a ldap server I have set up. Now I wan`t to implement sessions, so that when a user is inactive for a period of time (in the case below, 10 seconds), the session will end and the user will unbind from the ldap server. I found this excerpt of code:\[code\]<?php session_cache_expire(20); session_start(); $inactive = 10; if(isset($_SESSION['start'])) { $session_life = time() - $_SESSION['start']; if($session_life > $inactive){ header("Location: endSession.php"); } } $_SESSION['start'] = time();?>\[/code\]It is not working. If I refresh the page it redirects me to my 'endSession.php' page, even if I`m active.
 
Back
Top