Hi ,
I have two pages page1.php and page2.php. When I set the session on page1.php and print it, it works just fine. However, after the call to header and redirecting to the new page, I can't access my session variables anymore. It seems like they are deleted. I am running php on windows server. here is my code snippet:
page 1:
<head>
<?php session_start(); ?>
</head>
.....
$_SESSION['uservalidity'] = 'failed';
mysql_close($Stein);
header('Location: newslettersubscription.php
');
code for page 2:
<head>
<?php session_start(); ?>
</head>
<?php
echo "------>".$_SESSION['userv
alidity'];
if(isset($_SESSION['userva
lidity']))
{
......
}
?>
there is nothing after -----> on page2.php above.
Thanks,
Faraz
Start Free Trial