session not working on a php page



Hi All,

I am trying to experiment with sessions and they seem to be resetting
everytime i visit the page.

here is the code of the page

<?php
session_start();
$count = $_SESSION["counter"] + 1;
$_SESSION["counter"] = $count;
echo $_SESSION["counter"];
?>

if I refresh the page, the count doesn't increase. Whast should i do
to fix this?

any help is much appreciated

cheers
Suman
.



Relevant Pages

  • Re: register_globals - turning on
    ... >>default because of the history of PHP. ... >Sessions contain persistent data, ... >>paths are a tad confusing as well. ... >In the case of session data, the web server needs to be able ...
    (comp.lang.php)
  • Session Variables Disappear and Reappear
    ... New to PHP and I've checked previous posts and haven't seen similar problem. ... I can also destroy sessions. ... message will disappear showing the "Please Login Form". ...
    (php.general)
  • Re: register_globals - turning on
    ... >>an Apache module. ... >So basically using the .htaccess is a safe way of enabling sessions to ... >>Stick this file on the beginning of every PHP page processed. ... >>In the case of session data, the web server needs to be able ...
    (comp.lang.php)
  • RE: [PHP] Clearing POST variable on page refresh
    ... [PHP] Clearing POST variable on page refresh ... Since you don't want to use sessions, ... Less than a week on an ultra busy server. ... This is most likely not a php thing, but would there be a way to refresh the ...
    (php.general)
  • RE: [PHP] PHP not remembering sessions
    ... while this doesn't mean that save handler routines are not used, ... [PHP] PHP not remembering sessions ...
    (php.general)