in reply to Empty Cookie

Well, I don't know where is your problem. But what I have noted is that you are not showing your domain in your example. So, are you using "localhost" to test?

If you are using localhost ($ENV{HTTP_HOST} = 'localhost'), you can't set explicity a cookie for this host for security, since your Brownser won't let the server set the cookie. So, when you set a cookie to localhost you can't send the domain part!

Make some tests, sending only the name and value of the cookie, since is simpler to find the erro isolating it.

Other thing you need to know, and probably already know, is that you need to send the cookie before send the headers (content-type line).

Good luck!

Graciliano M. P.
"The creativity is the expression of the liberty".

Replies are listed 'Best First'.
Re: Re: Empty Cookie
by Anonymous Monk on Jun 28, 2003 at 02:03 UTC
    But what I have noted is that you are not showing your domain in your example.

    I'm using an actual tld in the format '.domain.com'

    The cookie is actually being set successfully, it's retrieving it that is the problem. That would lead me to believe it's a problem with the domain and/or path, but I've quadruple checked them and it all looks right.

    Other thing you need to know, and probably already know, is that you need to send the cookie before send the headers (content-type line).

    I'm currently sending the cookie with the code    print $q->header(-type=>'text/html', -cookie => $cookie); which seems to work. This couldn't be causing a problem, could it?

    Thanks for the help :)