Forum Moderators: coopster

Message Too Old, No Replies

Cookies: not being returned from browser(s)?

. . . wish to avoid regenerating info

         

grahamberends

11:40 pm on Jan 25, 2006 (gmt 0)

10+ Year Member



Hi there

I wish to set up an access class for robots. And, store the access_class in a cookie. BUT, my browser (masquerading as a robot) does not return the cookie to the server.

Why? Can you help me understand what is going wrong? :)

Platform: PHP4.x, Apache and Linux, browser = Mozilla.

My browser (masquerading as a robot) is set to accept all cookies, also: set to ask to accept. After the server establishes that the caller is a robot a cookie is successfully sent. (My browser shows me it)

But when the browser calls the same page again, the server side validation isset($_COOKIE[$this->cookie_name]) is negative, not true. Ie: there is no cookie returned. Why?

Here is a simplification of the logic:

function login_reader() {
if (isset($_COOKIE[$this->cookie_name])) {
. . strip out values stored in cookie_string
. . eg: access_class
. . when robot: this code is never visited
} else {
IF ( $this->test_if_robot() ) {
. . set access class, etc for robots
. . when robot: this code is visited every time
} else {
. . set access class, etc for visitors
}
. . setcookie
. . cookie lives until robot browser closes
}

Well, I hope you can help.

Look forward to your replies, thanks
GrahamB

FalseDawn

11:53 pm on Jan 25, 2006 (gmt 0)

10+ Year Member



Check the domain and path linked to the cookie.
[fr.php.net...]

grahamberends

8:16 pm on Jan 26, 2006 (gmt 0)

10+ Year Member



Hi Falsedawn!

Thanks for the lead. You have now put me onto several new tracks about cookies. Opening up the whole topic, also kicked me into seeing bugs, starting to see what's happening! :) !

Hmmmm!
GrahamB