Hi, > That's great help and exactly what I'd like to do timeouts and all. I > now just need to figure out he mechanics of the code for it and get a > better understanding of sessions. I'm thinking in the user table I'll > have a bunch of boolean fields for different permissions that apply to > different pages etc. To keep it simple at first I'll just have two > permissions "read only" and "edit". Read only users will not be allowed > to access pages where they can edit data. > > How do you check for idle? I suppose there is a built in variable that > you check against the value in the table. How do I pull up or refer to > session variables?
Sessions are stored in the $_SESSION array. A simple check would be: if ($_SESSION['user_id'] == "" || is_null($_SESSION['user_id'])) redirect_to_index_function(); Where 'user_id' is, that would be the name of the session you created. Just insert that at the top of each page (might be best suited in an include file). -Dan Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php