|
Posted by Frits van Leeuwen on 08/28/06 11:01
> > Hello,
> > I try to understand cookies.
> > This is what I have and it's working.
> >
> cookies are variables stored in user pc (client) by server.
> 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?
Navigation:
[Reply to this message]
|