Re: [PHP4BETA] Session Problems - New session ID's being created in ERROR.
[email protected] (Sascha Schumann)
| Newsgroups | php.version4 |
|---|---|
| Message-ID | <[email protected]> |
On Mon, 29 May 2000, August Zajonc wrote:
> It appears that there is no way to break PHP of the bad habit of sending
> along the path with the cookies it sets. This makes it close to useless for
> any serious work without some ugle work arounds.
>
> For example, setting a session in the /r/ directory sets a cookie with path
> /r. What this means is when you go to another page in the /a directory,
> whamo, you get a new session. Yuch.
>
> If you think
> session.cookie_path = /
>
> might do the trick, it appears cookie_path doesn't affect much of anything.
>
> I've seen this problem crop up a number of places, include Sessions problem
> earlier today, though most people don't finger the culprit immediatly.
>
> I'm hoping I'm missing something and this is some easy fix :)
The fix is in CVS. You can recompile PHP with the attached
patch applied and it should fix your problem.
- Sascha
difx
(text/plain, 518 B)
Index: session.c =================================================================== RCS file: /repository/php4/ext/session/session.c,v retrieving revision 1.141 retrieving revision 1.142 diff -u -r1.141 -r1.142 --- session.c 2000/05/26 13:02:11 1.141 +++ session.c 2000/05/29 15:07:19 1.142 @@ -664,7 +664,7 @@ strcat(cookie, PS(cookie_domain)); } - sapi_add_header(cookie, len, 0); + sapi_add_header(cookie, strlen(cookie), 0); } static ps_module *_php_find_ps_module(char *name PSLS_DC)