Sessions are acting strangely
| From: | Paul Marais | Date: | Mon, 28 Oct 2002 05:48:57 +0000 |
| Subject: | Sessions are acting strangely | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-121640@lists.php.net to get a copy of this message | ||
Hi there,
Im looking for ANY help regarding his problem - I find this interesting to
say the least.
I recently switched to a new hosting company - they are running php 4.1.2 -
register globals is ON.
the sessions automatically expire without closing the window. if you load
index.php and wait past 30 seconds - the session variables are empty -
Sometimes - although not reliably - if you wait another 30 seconds - the
variables are back? - this is very strange? - here are the files I have
setup to illustrate this problem.
Im using the default php-ini file - so no weird session expires or garbage
collections stuff.
Ive set up 3 basic files:
------------------------------------------------
index.php:
<?php
session_start();
session_register('var1','var2');
$var1 = "cat";
$var2 = "dog";
echo "Click <a href=\"sess2.php\">here</a> to view the session vars on
page
2";
?>
---------------------------------------------------
sess2.php:
<?php
session_start();
echo "Var1 = $var1, var2 = $var2";
echo "Click <a href=\"sess3.php\">here</a> to view the session vars on
page
3";
?>
------------------------------------------------------
sess3.php:
<?php
session_start();
echo "Var1 = $var1, var2 = $var2";
echo "Click <a href=\"sess2.php\">here</a> to view the session vars on
page
2";
echo "<br><br><br><br>Click <a
href=\"index.php\">here</a> to go back to
page 1 to reset the session vars";
?>
--------------------------------------------------------
Does anyone know if 4.1.2 had any session bugs?
Thanks for reading this ;-)
Paul
paul AT triplethree DOT com