Forum Moderators: coopster
session's variables are not passed to the next page in IE6.
Every page refresh creates a new session_id().
I'm using wamp/IE6, no software blocking cookies, and the privacy setting is set to Medium... I know i can pass the PHPSESSID to the next page, but security issues would not allow this method.
This code works is an example of what I'm trying to do, it works fine in Firefox... here are the basics:
t1.php
<?php
session_start();
error_reporting(E_ALL);
ini_set("display_errors", -1);
$mysession = session_id();
print_r($mysession);
print "<br>";
$_SESSION['test']="test";
print "<a href='t2.php'>t2</a>";
print "<br>";
$_SESSION['firstname'] = 'charlie';
print_r($_SESSION['firstname']);
print "<br>";
?>
The output for t1.php i.e.
ing0t5cn53kfa2ptb6l8duppa6
t2
charlie
t2.php
<?php
session_start();
$mysession = session_id();
print_r($mysession);
print "<br>";
print_r($_SESSION);
print "<br>";
print_r($_SESSION['test']);
print "<br>";
print_r($_SESSION['firstname']);
?>
the output for t2.php i.e.
bh9ueqb61gk3mriq5f3bem4jj1
Array ( )
Notice: Undefined index: test in C:\wamp\www\test\t2.php on line 12
Notice: Undefined index: firstname in C:\wamp\www\test\t2.php on line 16
IE6 creates a new session_id in the next page, so the session variables are tagged with undefined index...
This is my first time posting here... how can this be solved?
in your first page try: $_SESSION['mysession']=session_id();
and in your second page: print_r($_SESSION['mysession']);
(and you delete the $mysession = session_id(); in both pages)
try and play with this and see how its going
and welcome to webmasterworld