[thelist] PHP cookies and sessions

Andrew Forsberg andrew at thepander.co.nz
Wed Feb 13 14:39:01 CST 2002


Hi John,

>I'm reading the cookies/sessions sections of each of myy PHP books. tryign
>to get a grip on using sessions/cookies to save user preferences and tailor
>user content...
>
>Any good web tutorials you guys know of?

Just the reference to sessions:

http://www.php.net/manual/en/ref.session.php

Cookies are a pain in the @#$@&** &*(&. (Says Andrew, barely
containing his rage at the SSL / Cookie / Forms / multiple sub-domain
cruft he's just had to repair with messy IE workarounds.)

PHP's sessions are much easier to manage, and they abstract the
methods to access the data: you can store the variables associated
with the session in files, memory, or a db; the user can maintain
their session via cookies or GET variables.

>It works...the cookie variable/value is used, but I can't *find* the cookie
>anywhere in my computer's directory tree. It isn't showing up in 'temporary
>internet files' or 'Cookies' directories (where all the other cookies set by
>sites are). Any suggestions of where the cookie goes?

What's the name of the host? It'll be stored as a file with the
host's name, not the variable name. If you test your code with
Mozilla or NS 6 (I'm assuming you're testing with IE at the moment)
you should be able to find the cookie via the cookie manager.

Cheers
Andrew

--
Andrew Forsberg
---
uberNET - http://uber.net.nz/
the pander - http://thepander.co.nz/



More information about the thelist mailing list