Re: Retrieve all SESSION variables.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
To: Alf Stockton <alf@xxxxxxxxxxxxxx>
Cc: php windows <php-windows@xxxxxxxxxxxxx>
Sent: Friday, May 25, 2007 11:50:27 AM
Subject: Re:  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

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux