Page 1 of 1

session not persisting

Posted: Mon Dec 06, 2010 2:18 am
by stuckne1
Chunk of the first page. I do have session_start(); at the top of this one too.

I do this and the session ends up empty. it's just 0 every time.

Code: Select all

if(mysql_num_rows($result) > 0)
		{
			$_SESSION['login_name'] = $user_loginName;
			echo $_SESSION['login_name'];
			echo $result;	
			js_redirect('http://localhost/roomSplit/loggedIn.php',1); //Redirects to blogulate.com in 1 second.
		}
		else
		{
			echo("Wrong username/password.");
		}
2nd page

Code: Select all

<?php 
	session_start();  
	ini_set('display_errors',1); 
	error_reporting(E_ALL);
?>
<html>
	<title>Panel</title>
<body>
<?php 
	echo("Welcome " + $_SESSION['login_name']);
?>
</body>
</html>

Re: session not persisting

Posted: Mon Dec 06, 2010 3:21 am
by social_experiment
What does the query for $result look like

Re: session not persisting

Posted: Mon Dec 06, 2010 8:55 am
by stuckne1
fixed! Thanks.

Code: Select all

 echo("Welcome " . $_SESSION['login_name']);