fellow geeks,
I need help with sessions. They dont seem to work correctly on my machine (well, they do but they dont - let me explain).
if i have this code:
<?php
session_start();
session_register('count');
$count++;
echo "<P>You've been here $count times. Thanks!</p>";
?>
What i realize is (1) the count never increments and (2) a session file is created everytime i refresh the page (my cookie path and save path are set in the php.ini as c:\apache).
It doesnt seem to find the session it created. However a session does work with this code:
sessiontest.php
<?php
session_start();
?>
<head>
</head>
<body>
<?php
session_register("product1");
session_register("product2");
$product1 = "hello world!";
$product2 = "this is saved data!";
print session_encode();
print "<br>";
print "variables stuffed into session!";
print "<br>";
print "<br>";
?>
<br>
<a href="nextpage.php?<? print SID ?>">Next page</a>
</body>
nextpage.php
<?php
session_start();
?>
<head>
</head>
<body>
<?php
print $product1;
?>
<br>
<?php
print $product2;
?>
</body>
My questions are, does PHP automatically create a cookie with the session id? And why doesnt a session file delete itself when the session times out? I would *REALLY* like to see how some session code works!!
PULEAZE! this is very frustrating.
Thanks,
-Buzzlightyear
To Infinity and Beyond!