Posted: Mon Dec 15, 2003 5:32 pm
Hi,
I have a weird situation using sessions with one of the web hosts I use. Well I think it's weird maybe you can clarify?
php is set to use cookies for sessions and the trans_id is set to false.
Whenever I try to use sessions on this server if I simply use session_start() the variables are not available. I always have to pass the session id in a url of form otherwise it just won't work.
I have set my browser to 'allow all cookies' and tried this IE6, NS7.1 Mozilla 1.5 and always have this problem.
Here's a code example:
Page 1
Page 2
On page 1 the session variable are displayed. On page2 they are empty.
On my testing server on my PC this code works. On another hosts server I use it also works.
I think this behaviour seems wrong as I didn't think I need to pass the sessionid when php.ini was set to use cookies.
Any ideas?
Keith
I have a weird situation using sessions with one of the web hosts I use. Well I think it's weird maybe you can clarify?
php is set to use cookies for sessions and the trans_id is set to false.
Whenever I try to use sessions on this server if I simply use session_start() the variables are not available. I always have to pass the session id in a url of form otherwise it just won't work.
I have set my browser to 'allow all cookies' and tried this IE6, NS7.1 Mozilla 1.5 and always have this problem.
Here's a code example:
Page 1
Code: Select all
<?php
session_start();
$_SESSIONї'variable1']="Hello my name is";
$_SESSIONї'variable2']="Keith";
?>
html>
<head>
<title>Session testing</title>
</head>
<body>
<p><a href="session2.php">Click here to go to the next page where you should be able to access the session variables</a></p>
<p>The two session variables are</p>
<p>1)<?php echo $_SESSIONї'variable1']."<br>2)".$_SESSIONї'variable2'];?></p>
</body>
</html>Code: Select all
<?php
session_start();
?>
<html>
<head>
<title>Session testing</title>
</head>
<body>
<?php echo $_SESSIONї'variable1']." ".$_SESSIONї'variable2'];?>
</body>
</html>On my testing server on my PC this code works. On another hosts server I use it also works.
I think this behaviour seems wrong as I didn't think I need to pass the sessionid when php.ini was set to use cookies.
Any ideas?
Keith