|
I have
been through a crash course on cookies :-b
they
are interesting critters.
ok
first let me explain about the Cookie Jar.
(using
windows in these examples)
Under
your Windows folder or Document Settings folder depending on version of OS
there is a folder usually called cookies. these files are .TXT standard
text files and you will notice the they have usually your {network
[EMAIL PROTECTED] domain}.txt these are the Cookie Jar files. You have
no control over the cookie this is a handled by the browser in communication
with server you are connected to the drops the cookie on
you.
the
Cookie Jar holds Cookies.
Cookies are like ARGs in that there contain Name=Value
pair with a few extra attributes
A
Cookie
Name =
Cookie Name (required)
Value
= Cookie Data (required)
Path =
the path usually "/" for root
Expires = GMT Date on how long the cookie will stay in
the Jar
Secure
= true or false true means the cookie can only be read by an HTTPS secure
connection
Have
you ever wondered what those extra attributes on the @ASSIGN where for, well now
you know
<@ASSIGN NAME=name
VALUE=value [SCOPE=myscope]
[EXPIRES=timestamp] [PATH=path]
[DOMAIN=domain]
[SECURE=true|false]>
it is
just that easy to drop a cookie just set the scope as COOKIE
<@ASSIGN NAME="HELLO" VALUE="THERE"
SCOPE="COOKIE">
Now
this code will place an entry into the COOKIE JAR as
HELLO=THERE;
Without specifying the EXPIRES attribute this is a
SESSION cookie (kinda of like Local/Request Scope) when you leave the domain
that dropped the cookie the HELLO=THERE; will be deleted from the Cookie
Jar.
to set
the EXPIRES so the the cookies stays there in the jar use code
like
---
<@ASSIGN NAME="expsec" VALUE="<@CALC EXPR='((60 * 60) * 24)'>" SCOPE="local"> <@ASSIGN NAME="expirey" VALUE='<@TOGMT TS="<@SECSTOTS SECS='<@CALC EXPR="<@TSTOSECS TS=<@CURRENTTIMESTAMP>>+@@local$expsec">'>">' SCOPE="local"> <@ASSIGN NAME="expirey" VALUE='<@FORMAT STR="@@local$expirey" FORMAT="datetime:http" INFORMAT="datetime:<@VAR NAME='timestampFormat'>">' SCOPE="local"> @@local$expirey ---
Like...
<@ASSIGN NAME="HELLO" VALUE="THERE" SCOPE="COOKIE"
EXPIRES="@@local$expirey">
Now,
the cookie will stay in the Jar without molding ;-)
Ok,
you say now I have a Cookie in a Jar on there computer, how do I Eat
it
all
you have to do is reference the Name of the Cookie in the COOKIE
scope
<@VAR NAME="HELLO"
SCOPE="COOKIE">
or
@@cookie$HELLO
That's
it.
You
are now Eating and Tossing Cookies ;-)
There
is some more but this will get you started
Ben Johansen - http://www.pcforge.com
________________________________________________________________________ TO UNSUBSCRIBE: Go to http://www.witango.com/maillist.taf |
- Witango-Talk: cookies Atrix Wolfe
- RE: Witango-Talk: cookies Ben Johansen
- RE: Witango-Talk: cookies Scott Cadillac
- Re: Witango-Talk: cookies Atrix Wolfe
- Re: Witango-Talk: cookies witango man
- RE: Witango-Talk: cookies Scott Cadillac
- RE: Witango-Talk: cookies Nicholas Froome
- Re: Witango-Talk: cookies Atrix Wolfe
- RE: Witango-Talk: cookies Scott Cadillac
- RE: Witango-Talk: cookies Ben Johansen
- RE: Witango-Talk: cookies witango man
- RE: Witango-Talk: cookies Ben Johansen
