[ic] Help on cookies

Kevin Walsh interchange-users@interchange.redhat.com
Mon Apr 15 07:24:01 2002


> I'm in trouble with cookies, migrating to 4.8.3 version.
> I need to use the persistent cookies.
> In 4.8.3 I red that I need to add set-cookie directive,
> I use it, it generates cookies, but, if I use the same name of the 
> normal cookie (mv_session_id), closing and reopening  browser, it 
> generates another cookie that overrides the previous and clear the
> cart.
> 
> If I use a different name, like below, the cookie has not been red.
> Thi is my setting:
> [set_cookie name="save_basket" value="[data session id]" 
> expire="[calc]60*60*10+[time]%s[/time][/calc]"]
> 
> Can it depend from the name? I tried to set read-cookie with the 
> right name to the basket page but it seems to ignore it. It doesn't 
> read the persistent cookie.
> The cookie that has been generated is a little different from that 
> generated from the precedent version of Interchange, in fact the 
> value of it is the "number ID", instead of "number ID: IP".
> 
If you set a cookie with the same name that Interchange uses for
its session ID, and you store the session ID value "a little
differently", you shouldn't be surprised when Interchange fails
to recognise the cookie contents and simply creates a new session.

Apart from the above, you will need to read the [set-cookie]
documentation which shows the format you will need to use in
your "expire" parameter.  The [time] tag can be used to calculate
the time +10 hours and output the time in the correct format.
It will even use the (cookie standard) GMT time if you ask it to.

Remember that a user's ordinary session cookie and ID will remain
valid until the timeout period (SessionExpire) elapses.  This holds
true even if the user leaves your site and returns later.  If a user
closes their browser then its likely to be because they have finished
with their session.  Users will not be shocked to find that their
new cart is empty when they open a new browser.

-- 
   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    kevin@cursor.biz
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/