Re: Sessions - More Info

From: Date: Thu, 31 Mar 2011 23:11:10 +0000
Subject: Re: Sessions - More Info
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-312183@lists.php.net to get a copy of this message
Dear List - Thank you for your help in the past. This an update on my session problems. Here is a simple test program. It never increments the session counter; ie, does not detect that $_SESSION has been set. <?php session_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <html> <body> <?php if(isset($_SESSION['views'])) $_SESSION['views']=$_SESSION['views']+1; else $_SESSION['views']=1; echo "Views=". $_SESSION['views']; ?>
        </body>
</html> I have no idea what is wrong. I need to make my session variables work so that I can finish a project. Help and advice, please. Ethan Rosenberg MySQL 5.1 PHP 5.3.3-6 Linux [Debian (sid)] I tried your code on my testing computer (PHP 5.2.14) and everything works fine. $_SESSION['views'] is counting up correctly. Maybe a problem with your configuration?
Beste regards. Steven

« previous php.general (#312183) next »