Re: Retrieve all SESSION variables.
| From: | Jarrett Meyer | Date: | Fri, 25 May 2007 16:12:03 +0000 |
| Subject: | Re: Retrieve all SESSION variables. | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-27977@lists.php.net to get a copy of this message | ||
I think Stut is being a little sarcastic. :)
The
original question is correct: The method below ( foreach ($_SESSION as
$k => $v) ... ) will only tell you the current session variables for
the current user. That is intentional in the design of the $_SESSION
variable.
It will not tell you all of the possible session
variables or what another user may have as their session variables.
(i.e. if you haven't logged on to a page, you may not have a
$_SESSION["logon_timestamp"] key, even though it is a key that some
future page may care about.
You need to find how the sessions
are stored (file or DB) and look there. You can then parse the hash to
look at all of the available sessions.
(sorry for the previous message... need to check the "To" before hitting
"Send".)
jm
----
Jarrett M. T. Meyer
http://jarrettmeyer.blogspot.com
http://www.jarrettmeyer.com
No trees were harmed during this transmission; however, several electrons were terribly
inconvenienced.
----- Original Message ----
From: Stut <stuttle@gmail.com>
To: Alf Stockton <alf@stockton.co.za>
Cc: php windows <php-windows@lists.php.net>
Sent: Friday, May 25, 2007 11:50:27 AM
Subject: Re: [PHP-WIN] Retrieve all SESSION variables.
Alf Stockton wrote:
> Is there a method whereby one can retrieve all php SESSION variables on
> a Windows server.
> I have tried:-
>
> <?php
> session_start();
> foreach($_SESSION as $key => $val)
> {
> echo $key . " : " . $val . "<br>";
> }
> ?>
>
> but this appears to only return current user variables.
Shocking that. You think maybe there's some security-related reasoning
behind that?
Seriously tho, if you really really really need to do this, and I can't
think of a single good reason you would, you need to be looking at where
PHP is storing the session data as it provides no way to access other
users session data due to the aforementioned security-related reasoning.
-Stut
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php