Page 1 of 1

Session Variables not working.

Posted: Wed Oct 12, 2005 8:49 am
by Subaru
Hi all.

I am building a PHP CMS at the moment, and for some reason it seems that my session variables are being stored. I am using a default setup of Apache / PHP / MySQL with Linux Fedora Core 2. I am unsure as to which versions theses all are, but they are the standard ones.

I am making a module to display the logged-in users information. For example.

"Welcome, Logged in as $user."
"Account Type: $thegroup"

When i make the user "login" it seems to parse through the login checks ok, and use the variables $user, $pass, $SESSION_['user'] and $SESSION_['pass'].

For some reason if i type

echo $SESSION_['user'];

It doesnt display anything.


Any ideas? :?

Posted: Wed Oct 12, 2005 9:07 am
by chrys
Yes, the session global is $_SESSION not $SESSION_

Posted: Wed Oct 12, 2005 9:25 am
by shiznatix
and don't forget session_start(); at the top of your page :wink:

Posted: Fri Oct 21, 2005 7:39 pm
by Subaru
Thanks guys, ill try out the swapped around session tags. If thats all it is im gonna feel like an idiot, but hey we all have to learn sooner or later.