|
Posted by J.O. Aho on 11/23/05 09:32
joeblow wrote:
> It seems that everyone avoids these $_SESSION questions like the plague. Is
> it because there is too much involved to diagnose from a distance?
>
> Because I swear, if I don't find this problem I think I'm gonna slit my
> wrists. I've been trying to get sessions to work for months and it just
> doesn't happen. I've read article after article, the manual, tutorials, etc.
> and can't find a description of the mechanism that causes sessions and
> cookies to work together. The manual describes using the URL to propagate
> the id, but not the mechanism behind cookies.
>
> With WinXP, IE6, PHP5, are there any undocumented issues anyone has learned?
>
> The session writes files and stores relevant data, but $_SESSION is unable
> to access the values after navigating to another page.
>
> How do sessions work with cookies?
You need to see that no output from the PHP pages is generated before you use
the session, eg
---start of file---
<?PHP
...
?>
--- end of file ---
This page wouldn't work for sessions, as there is a newline on it.
You should run session_set_cookie_params() if your default settings aren't
okey, the broken browser (MSIE) has problems if there hasn't been a domain and
path set.
//Aho
[Back to original message]
|