severndigital Posted November 9, 2007 Share Posted November 9, 2007 ok .. I am now having another problem. my sessions aren't holding. I have an index page that uses a switch with the sesssion_start(); as the first line. //start the session session_start(); //define includes include_once('lib/connect_db.php'); include_once('func/system.func.php'); include_once('class/system.class.php'); include_once('func/session.func.php'); //start main index.php switch switch($_GET['view']){ ## case 'login': $doLogin = doLogin(); if($doLogin[0] == 0){ $error = $doLogin[2]; $mainContent = $doLogin[3]; }else if($doLogin[0] == 1){ $regSessions = registerSessions($item=$doLogin); $mainContent = $doLogin[8]; } break; ## case 'campaign': $mainContent = 'camps/newcamp.php'; break; ## case 'logout': //$destroy = destroyAll(); $error = '<span class="error">You have been logged out.</span>'; $mainContent = 'forms/login.php'; break; } include_once('template.php'); when I login it .. i get all my sessions and they are registered. as soon as I navigate away from the login case and goto anything, in this chunk of code the campaign case, I loose all my sessions any ideas?? thanks chris *******EDIT ************ sorry for the DUP post. i got a MySQL error from the site. Quote Link to comment Share on other sites More sharing options...
nafetski Posted November 9, 2007 Share Posted November 9, 2007 Where in this script are you saving session variables? Maybe I'm not understanding the question =P Quote Link to comment Share on other sites More sharing options...
severndigital Posted November 9, 2007 Author Share Posted November 9, 2007 the script is saving them by calling the registerSesssions() function here is the code for that. function registerSessions($item){ foreach($item as $key => $val){ //session_register("$key"); $_SESSION["$key"] = $val; } }//END registerSessions Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.