[CLUE-Tech] PHP Sessions and Cookies: Brain Cramp

Jeffery Cann fabian at jefferycann.com
Sat Oct 12 21:42:51 MDT 2002


Jed,

I think the cookie should be set when you do the redirect.  Are you doing 
this?

 header( "redirect URL" );

Also, check the session.cookie_lifetime set to in your php.ini?

Finally, when I wonder about cookies, I will telnet to my web box and do a GET 
on the URL, so I can view the headers outside of the browser.  This will 
confirm whether the cookie is being sent by the server or if you have some 
browser weirdness.

$ telnet www.yourserver.com 80
GET /jed/login.php

Jeff

On Saturday 12 October 2002 04:01 pm, Jed S. Baer wrote:
> Hi Folks
>
> I'm stuck. I must be missing something obvious, so clearly, I won't see
> it. ;-)
>
> I have this php/mysql thing I'm writing, and it has user accounts and
> authentication of same.
>
> The login.php prints a form that calls authenticate.php. authenticate.php
> does a session_start() if the user/pass is good, and then does a location
> header to redirect to the main page.
>
> What I don't know, is at what point in this process the session cookie
> would be set. And, just to see if anything at all is working, I put a
> session_start() at the top of the login.php script. The thing is, no
> cookie is being set. I've turned off privoxy, and checked all my cookie
> settings in Galeon. Tried with Mozilla too.
>
> So, I deleted some cookies for another site, and logged in, and yes,
> cookies are in general working.
>
> So, I'm sorta stuck now, trying to figure out why the whole login thing
> isn't working. It's a RH7.2 box, running Apache 1.3 and PHP4.
>
> TIA
> jed




More information about the clue-tech mailing list