> >1: Rid any whitespace between '<?php' and 'session_start()'
That makes no difference as long as you are not producing any output.
You can have spaces and code withing the php brackets, just not echo anything.
But don't have any spaces prior to <?php since it will be echoing a character.
The reason is that you are setting a cookie and making a header call.
> >2: You need to populate the variable you wish to use as a session
> >variable before registering it
I don't agree with that either
>> Without even going to another page, the $PHPSESSID and
>> $UserName variables are both empty. They are also empty on subsequent
If you don't leave the page and your variable is empty, that means it in
empty within PHP in the first place.
The variable within the session will not be retrieved until you hit the next
Your PHPSESSID will be also empty because it is the value that get
transferred to another page.If you didn't transfer yet, you will not have a
If you want your session id, do:
Also, be careful about the scope of your cookies.
A session is transfered through cookies in php (if available) and if you
don't set your scope right, your session can be lost from one folder to
That brings me to a MySQL question for knowledgeable people:
I don't use php sessions but a custom session that is stored in a simple
tables. I just transfer the a variable which holds the id to my session
(which is a primary auto-increment int) that points to a row which holds all
the information I need about the user.
Is it smart or is it a total waste of resources and I should stick with php
built in support for sessions?
So far, I never experienced any problems with it.
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]