More Fun With Sessions!

From: Date: Wed, 23 Jan 2002 20:31:49 +0000
Subject: More Fun With Sessions!
Groups: php.general 
Request: Send a blank email to php-general+get-81753@lists.php.net to get a copy of this message
Well, I was having problems getting sessions working at all on my FreeBSD box, but they are now working... But that leads me to more problems... For any others that might have a problem w/ FreeBSD, try setting the referer_check to 0 'session.referer_check = 0' Once I changed that things seem to be working, ie. I can get a simple count script to run with no probs, but here is where I come across a new problem. This script works fine (it counts as I reload it): <?php session_start(); session_register('counter'); $counter++; echo("You have visited this page $counter times."); ?> What I am wanting to run on the site is a shopping cart app (along with some other scripts that utilize sessions) that I wrote myself. Everything works fine on my home linux box, but doesn't seem to be working on the FreeBSD box. Maybe I am just not using sessions properly, but it is bugging me because it works on the linux box... Here's an example: test.php: <?php session_start(); session_register('counter'); $counter++; echo("You have visited this page $counter times.\n"); ?> <a href="test2.php">click here</a> test2.php: <?php session_start(); session_register('counter'); $counter++; echo("You have visited this page $counter times.\n"); ?> <a href="test.php">click here</a> Shouldn't this hold the same counter variable for both pages? It works fine on my linux box, but on the FreeBSD box, $counter is always 1. I think that if I could get something like this script working, then the shopping cart would also work. Sorry for the long message! Any help would be greatly appreciated. Jeff

« previous php.general (#81753) next »