Re: session not working on a php page
- From: "C. (http://symcbean.blogspot.com/)" <colin.mckinnon@xxxxxxxxx>
- Date: Sun, 13 Apr 2008 13:19:11 -0700 (PDT)
On 13 Apr, 13:15, Suman <YoS...@xxxxxxxxx> wrote:
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
Find the problem - the code is fine. But the most common cause of
cookie related problems is output before a header or cookie realted
statement - PHP is very good at intercepting and reporting this - why
have you not checked your logs? Do you know how errors are recorded/
reported?
Even if that turns up nothing - you should look at the HTTP data
passing to and from the browser - you can use firebug or tamperdata
for Firefox, or iehttpheaders for MSIE. Or just sniff the traffic with
wireshark. Then you can verify if the server is presenting a cookie,
and if the browsers retruns it in subsequent requests.
C.
.
- Follow-Ups:
- Re: session not working on a php page
- From: Suman
- Re: session not working on a php page
- References:
- session not working on a php page
- From: Suman
- session not working on a php page
- Prev by Date: Re: Segmentation fault (11)
- Next by Date: Re: sending mail from localhost to yahoo, gmail, hotmail, etc
- Previous by thread: Re: session not working on a php page
- Next by thread: Re: session not working on a php page
- Index(es):
Relevant Pages
|