I'm just a few weeks into learning PHP, and now wants to understand sessions. But I've run into trouble with the very first script I've tried, even though it's more or less copied from the PHP manual.

include ("html_functions.php");
$title = "Anders testing SID";
$header = " ";
html_begin ($title, $header);
if (!session_is_registered('count')) {
$count = 1;
else {

<?php echo $_COOKIE["PHPSESSID"]?>
Hello visitor, you have seen this page <?php echo $count; ?> times.<p>

To continue, <A HREF="visasida.php?<?php echo SID?>">click here</A>


The session id isn't attached to the link in the end of the script, and therefore $count always is '1', even after I click the link.

But the $_COOKIE["PHPSESSID"] does contain a value.

I'm using PHP 4.2.2 and according to phpinfo() session.use_trans_sid is set to '1'. What I'm missing?

Best regards,
Anders Thoresson

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to