Re: please explane cookies.
- From: "Frits van Leeuwen" <Frits.vanLeeuwen@xxxxxxxxx>
- Date: Mon, 28 Aug 2006 13:01:36 +0200
Hello,cookies are variables stored in user pc (client) by server.
I try to understand cookies.
This is what I have and it's working.
When client load the page first send to server the variable so
the server knows it.
This is how work cookies.
There are some data that make a cookie:
name for referring it
value ... of course!
the time of live of the valiable
the scope (visibility) of variable.
Think to cookie as an array of these value (name, value, time, scope...)
in client.
Said that there are some function:
setcookie is used to write the value toclient.
$_COOKIES[name_of_variable] for reading it
Probabli the difficult you find in this script i due to
the time of processing it:
The first time you call it just write th cookie.
from the second time the cookie is setted!
Ok, Thise I do understand.
I still have some questions.
Is it possible to set a cookie without a timestamp? (o it's always on the
computer. until the user ....)
When I the cookie is already setted, I like to use it. When I use it, i have
to set it. After setcookie, I use the last cookie setted file, but als I
overwrite that one with the new one. So the next time I use the cookie, I
have the settings of the last time.
Perhaps I have a answere by myself. Should it work?
I can checkabout the settings:
is setted? Y/N
Y? check language (is set in a cookie)
- NL= start a new PHP file with a setcookie with the settings for
language=NL.
- EN= ... etc.
N? give chooice and setcookie
But how do I do this?
.
- Follow-Ups:
- Re: please explane cookies.
- From: mario.lat_
- Re: please explane cookies.
- References:
- please explane cookies.
- From: Frits van Leeuwen
- Re: please explane cookies.
- From: mario.lat_
- please explane cookies.
- Prev by Date: Re: Basic question about adding numbers from DB
- Next by Date: Re: please explane cookies.
- Previous by thread: Re: please explane cookies.
- Next by thread: Re: please explane cookies.
- Index(es):
Relevant Pages
|