On 19-Jun-2003 Steve Keller wrote:
At 6/19/2003 02:10 PM, Sparky Kopetzky wrote:
2. How do you put 2 items that you want to save in the cookie and
retrieve??
Smuch 'em together into a single variable with a delimiter you're sure
won't show up in either value, something like #@@#,
Hello,
This is a reply to an e-mail that you wrote on Thu, 19 Jun 2003 at 21:13,
lines prefixed by '' were originally written by you.
Yes, this question is about PHP cookies.
Two questions:
1. How do you setup a cookie that will not expire??
You can't, but you can use an expiry date in the
1. Set a big value in seconds for the time argument
2. Send 2 cookies
OR
Create one string value containing the two values you want to save,
seperated by a a sepcific character of your choice and send this new value
as your cookie. Remember to parse the cookie's value when you request it in
Both.
1. If you don't specify an expiration date, it's good for the session.
Usually this means until the exit the browser. Otherwise you must set a
date far into the future.
2. You can name cookies, thus storing multiple values in multiple
cookies. Or you can store multiple values in one
1. How do you setup a cookie that will not expire??
You can't.
2. How do you put 2 items that you want to save in
the cookie and retrieve?? Examples in the PHP manual
only show how to work with a single value.
You can't. Use an array or two cookies.
---John Holmes...
--
PHP General
Hi,
1. How do you setup a cookie that will not expire??
You can't
however you could just set the year into the distance future a few
years.
-Dan Joseph
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hi,
this is an extract from setcookie documentation - how to handle a cookie
array.
Is this what you were looking for??
You may also set array cookies by using array notation in the cookie name.
This has the effect of setting as many cookies as you have array elements,
but when the
At 6/19/2003 02:10 PM, Sparky Kopetzky wrote:
2. How do you put 2 items that you want to save in the cookie and
retrieve??
Smuch 'em together into a single variable with a delimiter you're sure
won't show up in either value, something like #@@#, between them. Then,
when you read the cookie
For (2) you could even build an array, object, etc. if you need to store several
values and use serialize() right before setting the cookie, and unserialize when you
retrieve the cookie.
Joseph
Henning Sittler [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]
1. Set a big value in
9 matches
Mail list logo