[nycphp-talk] Sessions
e_dave
drodriguez1 at mac.com
Tue Jan 28 16:48:58 EST 2003
OK, but all I did was enter the usual META TAG info. So I take it you
might be talking about something else.
What is happening is that on the page "frontpage.php" one enters their
user name and password.
Then the same page is called to verify the user and create a session
with the user's info.
Now using the header() function, frontpage.php is called once more with
the session id on the end of the URL. And when I try to access the
user's info such as
if (isset($HTTP_SESSION_VARS['userID'])){
echo $HTTP_SESSION_VARS['userName'];
}
I get nothing unless I say start_session() before the if statement.
However doing that triggers the error I mentioned earlier.
D.
On Tuesday, January 28, 2003, at 04:28 PM, Adam Fields wrote:
> On Tue, Jan 28, 2003 at 04:25:44PM -0500, e_dave wrote:
>> Let's try that one more time, in plain text.
>>
>> Can someone point me in the right direction? I am writing what I
>> think
>> is a fairly simple session authentication script, but I keep getting
>> the following error:
>>
>> Warning : Cannot send session cache limiter - headers already sent
>> (output started at /Library/WebServer/Documents/DSMetro/header.php:16)
>> in /Library/WebServer/Documents/DSMetro/frontpage.php on line 111
>>
>> It sounds to me like the problem is due to the http headers at the top
>> of the page, but I don't know how best to handle this. I don't want
>> to
>> leave out the headers, right?
>>
>> Your friendly neighborhood newbie.
>
> Basically, session info is sent in the header of the page, which must
> be sent prior to any content. Normally, this is done by the server,
> transparently to you. If you're mucking with any of the header info
> using PHP commands, those commands must appear before anything that
> sends output to the page, including whitespace.
>
> --
> - Adam
>
> -----
> Adam Fields, Managing Partner, fields at surgam.net
> Surgam, Inc. is a technology consulting firm with strong background in
> delivering scalable and robust enterprise web and IT applications.
> http://www.adamfields.com
>
>
> --- Unsubscribe at http://nyphp.org/list/ ---
>
>
More information about the talk
mailing list