Re: $_SESSION unset for other user



"avlee" <xx@xxxxx> wrote in message news:op.tlkugdal1sq83a@xxxxxxxxx
Hello

I have application in php where users login and logout.
I wanted to create function for administrator which will
delete all session's data for other users.
For example, each user session data is written in:
$_SESSION['$username']['data']


Single quotes and variables don't mix. Use $_SESSION[$username] or
$_SESSION["$username"], but not $_SESSION['$username']. '$username' means
literally a string $username, the variable is not replaced in the string
like it does when "$username" is used... Try this:

$foo = bar;
echo '$foo'; // prints: $foo
echo "$foo"; // prints: bar
echo $foo; // prints: bar

--
"Ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" - lpk
http://outolempi.net/ahdistus/ - Satunnaisesti päivittyvä nettisarjis
spam@xxxxxxxxxxxxx | rot13(xvzzb@xxxxxxxxxxxxx)


.