Just to add to Ben's post - if you using an Assign action - set the scope to cookie - right click and select properties - in there you can set the other cookie attributes as Ben described (Bens method is just as good but if you want to use a GUI instead....)
 
 
 


Ben Johansen <[EMAIL PROTECTED]> wrote:
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
-Authorized WiTango Reseller
 http://www.pcforge.com/WitangoGoodies.htm
-Authorized Alt-N Reseller
 http://www.pcforge.com/AltN.htm

-----Original Message-----
From: Atrix Wolfe [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 30, 2003 6:22 PM
To: [EMAIL PROTECTED]
Subject: Witango-Talk: cookies

Hey Ben, you said cookies could offload variable storage.  I dont know anything about cookies, is that data stored in files on the user's computer or is it more like post args or something else?  It sounds really cool, is it easy to do in witango?
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/maillist.taf
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/maillist.taf


Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/maillist.taf

Reply via email to