sessions lost
Posted: Thu Feb 22, 2007 11:17 pm
My sessions are being lost i donno why
-----------------------------------------------------
First I am using thjis code to set the session variablesand this works and sets the session vars
and then using this code to get the values of the session variablesBut its just going blank but browser shows that there are PHPSESID Cookie Stored in the browser although session_id() is not showing anything its acting as $_SESSION is not set
-----------------------------------------------------
First I am using thjis code to set the session variables
Code: Select all
<?php
header("Content-Type: text/plain");
session_start();
$_SESSION["Name"] = "Hello";
echo session_id()."\n";
print_r($_SESSION);
?>and then using this code to get the values of the session variables
Code: Select all
<?php
header("Content-Type: text/plain");
//session_start();
//$_SESSION["Name"] = "Hello";
echo session_id()."\n";
print_r($_SESSION);
?>