Jump to content

session problems part 2


severndigital

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/76644-session-problems-part-2/
Share on other sites

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

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.