Re: AW: Sessions
| From: | Daniel Beulshausen | Date: | Sun, 27 Aug 2000 18:27:14 +0000 |
| Subject: | Re: AW: Sessions | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-2187@lists.php.net to get a copy of this message | ||
hi
> hope it's a nice morning in uk
atleast it's a nice evening in germany :)
> I've solved the session - problem
> (had set an directory to session.save_path and it seems that
> php does't like that, even it exists)
had php full access right's to that dir?
> <?
> session_register("x")."<br>";
> $x=12;
> echo SID."<br>";
> $s=SID;
> echo "<a href=session2.php?$s>go to 2</a>";
> ?>
bad snippet :) it misses atleast session_start()
<?
session_start();
$x=12;
session_register("x");
echo "<a href=session2.php?" . SID . ">go to 2</a><br>";
?>
> session2.php
> <?
> session_start();
> echo SID."<br>";
> echo session_is_registered("x")."<br>";
> echo $x."<br>";
> ?>
<?
session_start()
print SID . "<br>";
if(session_is_registered("x"))
print $x;
?>
it all behaves like i expected it too, but continue reading.
> "The <?=SID?> is not necessary, if --enable-trans-sid was used to compile
> PHP. "
> (from php.net) // the <?=SID?> is wrong!!
it's not wrong. and it's only needed if you don't use cookies.
SID is a normal constant:
<html>
<blabla>
<a href="link.html<?=SID?>">your SID: <?=SID?></a>
btw:
you can double check with
if(defined("SID"))
print SID;
and there's a difference between SID and session_id()
SID = session_name() . "=" . session_id();
> to send the SID via get in the URI is 'ugly' and perhaps Daniel
Beulshausen
> [daniel@php4win.de]
> is able to fix that ??
so you want a binary compiled with trans-sid? and what bug, we may call it a
feature...
if you want to use this method turn off session.use_cookies, then you may
supply the SID in the URL.
if you have cookies turned on it won't work like expected, cause it get's
overridden by the cookie.
cause the SID is only necessary for the url, it's not the session id!
so i think it's a feature (expected behaviour)
> I think at the moment it only works via URI
and via cookies, check your setting's in the php.ini for
session.use_cookies.
greetings
daniel
/*--
daniel beulshausen - daniel@php4win.de
using php on windows? http://www.php4win.de