Jump to content

session problem


vatzcar

Recommended Posts

i'm trying to make a login session for users. now after starting session session variables are getting destroyed when i'm changing the page. my code is like this

 

......
                        // start the session
		session_start();
		// set the session variable so we can check lated whether the user has logged in
		// or not
		$_SESSION['user_logged'] = true;
		// another session variable to determine which interface is to be called
		$_SESSION['interface_id'] = 1;
		// now redirect to main page
		$text = GenHeaderHTML(2);
                        ....

function GenHeaderHTML($processid){
                // include the file which contains header HTML part
	include("header.php");
                // if one process requested then redirect to admin page to show the interface dynamically
	if($processid == 1){
		$pretext = "\n<BODY>\n";
	}else{
		$pretext = "\n<BODY onload=window.location=\"admin.php\";>\n";
	}
	$pretext .= "<TABLE width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"center\">\n";
	$pretext .= "\t<TR>\n";
	$pretext .= "\t   <TD width=\"80%\">";

	return $pretext;
}

 

when i'm not redirecting i'm getting the session variables. even i've tried to create a link to admin.php, whenever i'm using that link still those session variables are getting destroyed. what's wrong i'm doing?

Link to comment
https://forums.phpfreaks.com/topic/38424-session-problem/
Share on other sites

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.