|
-
Mar 21st, 2006, 05:35 AM
#1
Thread Starter
Don't Panic!
[RESOLVED] Session variables
Hi,
Treading quietly into the world of Php/MySql I am experimenting...
Now if you picture a mad scientist type, you'd have the white lab coat with some weird colours in place and perhaps a singe mark near the bottom, goggles on (bit of sellotape holding the strap). and the scientist is pouring two flasks of liquid together. Now the scientist is expecting a colour change, however the liquid is clear.
The problem:
On the index page I am getting a check of session variables. Just looping through all of them.
Then on a login php processing page it fills session variables.
However, when going back to the index page only one variable is there (UserID) which is weird. Should be 5 at least. So I check the processing page, 5 listed.
Back to the main page. 1 again ... 
So I put in a clear session vars loop in the php, and run it.
Now no vars available.
The index page still has one var - UserID.
What is going on?
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Mar 21st, 2006, 09:33 AM
#2
<?="Moderator"?>
Re: Session variables
When you say 5 listed, do you mean 5 UserID's? Can you post some code so we can see whats happening exactly
-
Mar 21st, 2006, 09:42 AM
#3
Re: Session variables
Have you initialised the session correctly on the index pages?
Last edited by penagate; Mar 21st, 2006 at 10:33 AM.
Reason: minorly catastrophic spelling error. Couldn't have that now could we!
-
Mar 21st, 2006, 10:31 AM
#4
Thread Starter
Don't Panic!
Re: Session variables
john - 5 variables held on the session object
penagate - Uh apparently not.
After a little head bashing and a minor headache. Some delving on php.net and in a wrox book, I needed to put session_start() at the beginning of every page that needed to use the session variables.
So thats better and appears to (almost) work the way I want.
I'm doing the simplistic log on screen. Anyway. Thanks for the pointers.
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|