From: napalm at spiderfish dot net
Operating system: redhat linux
PHP version: 4.3.2
PHP Bug Type: Unknown/Other Function
Bug description: strange cookie behaviour

The problem:

- Theoretically

Login Page: Checks if one of the cookies variables is set and if so,
proceed with the login. Otherwise shows the login form. On submit calls
the dologin() function.

Login: Access db, register session variables and cookies (if checkbox is
checked) -> Redirects to temp.php -> Since the user is logged in, shows
the option for logout.

Logout: Unsets session variables as well as cookies -> Redirects to
temp.php?actID=0 - logout() -> Since the session was destroyed the user is
now sent to the login page but this time with a notice that he was
sucessfully logged out.

- Practically

Login: Everything smooth

Logout: The unset part goes without any problem and after the redirection
the user is sent again to the login page. At this point I can't understand
how but the $this->dologin() function is called. The final output will be
exactly the same as if the user is logging in for the first time without
any notice of the sucessful logout as supposed.


Strange facts:

- I checked if the cookie was set and the answer is NO so how could the
dologin function be called???
- Tried to remove the mysql functions from the dologin() and it worked
- Tried to comment the "$this->dologin($_COOKIE['sl_reporterid'],
$_COOKIE['sl_password'], NULL, 1);" line and guess what, it worked as
- If the script dont store any cookies (checkbox !checked) it works ok.

I did a great effort to understand what was going and since I could't live
without knowing the cause I reported what I think it's some "kind" of

Script source: [url][/url]
Working example #1: [url][/url] - with
the problem
Working example #2: [url][/url] -
without the problem (commented the line that calls the dologin function as
refered above)
PHP Info: [url][/url]

Best Regards


Edit bug report at [url][/url]
Try a CVS snapshot (php4): [url][/url]
Try a CVS snapshot (php5): [url][/url]
Fixed in CVS: [url][/url]
Fixed in release: [url][/url]
Need backtrace: [url][/url]
Try newer version: [url][/url]
Not developer issue: [url][/url]
Expected behavior: [url][/url]
Not enough info: [url][/url]
Submitted twice: [url][/url]
register_globals: [url][/url]
PHP 3 support discontinued: [url][/url]
Daylight Savings: [url][/url]
IIS Stability: [url][/url]
Install GNU Sed: [url][/url]