tsilenzio Posted August 1, 2007 Share Posted August 1, 2007 I made a similar but way more advance function php - page to manage with all the session stuff but I was wondering if i do somethign like include('includes/functions_session.php'); at the top of index.php or login.php if it will do everythign fine since its in a function. Ontop of that note will isset($_SESSION['someName']) and !(isset($_SESSION['someName'])) work with conditional things like IF statments <?php /******************************************************** * functions_session.php * * Deals with everything involving sessions ********************************************************/ // // Start the session and if this is first time running then setup // default values into what variables will later be used // function sessionStart() { if(start_session()) { if((!isset($_SESSION['Managed'])) || ($_SESSION['Manged'] === false)) { // // Update user's cache so it will expire in one hour // cacheUpdate(60); // // Assign default values to session array // $_SESSION['LoggedIn'] = 0; $_SESSION['UserID'] = 1; $_SESSION['AuthID'] = 0; $_SESSION['Error'] = 'None'; $_SESSION['Managed'] = true; } } } // // Update the amount of time that the session variable will be autodeleted // if for some reason no value is provided set a default time of 60 minutes // function cacheUpdate($time = 60) { session_cache_expire($time); } ?> Thank you so much for your time! - tsilenzio Link to comment https://forums.phpfreaks.com/topic/62785-solved-help-session-managment/ Share on other sites More sharing options...
tsilenzio Posted August 1, 2007 Author Share Posted August 1, 2007 meant to say in code up there [ session_start() ] instead i had [ start_session() ] Link to comment https://forums.phpfreaks.com/topic/62785-solved-help-session-managment/#findComment-312583 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.