Q1.  If you simply wish to READ the cookie from each web page, you need do
nothing.  It is created atuomatically as a variable for you.  For instance,
a cookie named
"mycookie" is available as $mycookie.

Q2.  The Cookie Path is the reference point on the web server.  I creates a
context for the cookie.  It allows the cookie to be read when a web page
comes from that specific directory.  If you want it to be available from all
directories, use "/".

Q3.  The cookie can store multiple values that you concatenate together.
For instance, to store username/password:
        setcookie( "cookiename", "$user#$password", time()+3600, "/",
".mydomain.com" );
Then, upon reading the cookie: list($user,$password) = explode( "#",
$cookiename );


FYI...setcookie() has worked for me on IE 5.x and NN 5.x.

-----Original Message-----
From: Jason Caldwell [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 17, 2001 11:35 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Cookies ???


I've been reading the threads under SETCOOKIE (from php.net) -- some people
are saying that setcookie doesn't seem to work for all browsers all of the
time.  Then some others go into how it seems to actually be the TIME format
(unix time vs. GMT time) --

Should I just stick to the HEADER version instead of setcookie?

Also -- I'm not completely clear on how cookies work in the first place...

Q1: When I set a cookie, is that cookie automatically called from *each*
page on my website?  Or, do I need to add the HEADER to each page where I
want to call the cookie?

Q2: The 'Cookie Path' -- is this the PATH on my websever -- someone please
explain what this is exactly, and how it works.

Q3: The scenario I would like to use cookies in is to have users
automatically be logged in when they come to my home page... so I will need
to store the Username and Password in the cookie... should I store these in
an Array, or can I create multiple cookies -- in other words, a cookie can
only store one value, correct?  So, I can use Serialize / Unserialize to
store Array information in my cookies?

Thanks.
Jason




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to