Re: sessions failing to persist
| From: | omer | Date: | Mon, 03 May 2004 21:35:31 +0000 |
| Subject: | Re: sessions failing to persist | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-185259@lists.php.net to get a copy of this message | ||
the problem suggest to me that you probably do not have the directory that
the sessions get stored on the server side properly existing and
permissioned. make sure that your php.ini defined location exists. also
make sure that your php code is not over-riding your php.ini by defining a
different location. also perhaps you have renamed the sessionid label from
phpsessionid to somthing else? try testing by switching cookies completely
off on you browser and then trying to go to the php script. youll then see
the session# in the url field.
rgrds,
omer.
"Michael R. Wayne" <phpuser@wayne47.com> wrote in message
news:200405030440.i434eIMm022395@manor.msen.com...
>
> As I posted last week, I seem unable to have sessions persist. I
> have ruled out https as a problem, the following simple script,
> installed as xxx.php will generate a new session number every time
> the field is filled in and "Submit" is hit.
>
> Note that I am not using cookies, the relevant session variables are:
> Session Support enabled
> session.auto_start On
> session.use_cookies Off
> session.use_trans_sid On
>
> When run, the session file appears to contain stage=1 but never is being
> read.
>
> I suspect I'm missing something obvious, any pointers?
>
> /\/\ \/\/
>
> <?
> if (!session_is_registered("stage")) {
> $_SESSION["stage"] = 0;
> $_POST['field'] = "";
> session_register("stage");
> }
> ?>
> <html> <head><title>PHP Test page</title></head>
> <body>
> <?
> echo "Stage:"; echo $_SESSION["stage"];
> echo " SessionID: "; echo session_id();
> $_SESSION["stage"] = 1;
> ?>
> <form method=post action="xxx.php">
> <input type=text maxlength=7 size=7 name=field value="<?echo
$_POST['field']?>">
> <input type=submit value="Submit">
> </form>
> <?
> echo "Stage:"; echo $_SESSION["stage"];
> ?>
>
> </body> </html>