[Zope] Re: reading a cookie from another PATH??

Trevor Toenjes zope@toenjes.com
Thu, 6 Sep 2001 18:57:03 -0400


There might be a better way to do this, but I am attempting to do user
tracking thru the site based on a GUID.
My goal is true click-stream collection and analysis.
Calling a setGUID method doesnt seem to work, and I dont know if it is
cookies behavior or my code?  if you come into the site thru /foo, one way
works,

Folder www.bar.com
###index_html
<dtml-if "REQUEST.has_key('GUID')">
  <dtml-var GUID>
<dtml-else>
<dtml-var setGUID>
</dtml-if>

###dtml-method - setGUID
<dtml-call "REQUEST.set('ts', ZopeTime())">
<dtml-call "REQUEST.set('uid_global',_.str(_.int(ts)))">
<dtml-call "RESPONSE.setCookie('GUID', uid_global, expires='Wed, 19 Feb 2020
14:28:00 GMT',domain='.bar.com', path='/')">

Folder www.bar.com/foo
###dtml-method
<dtml-if "REQUEST.has_key('GUID')">
  <dtml-var body_root>
<dtml-else>
<dtml-var setGUID>
</dtml-if>
<dtml-var GUID>    <--! fails to render if this is the users first page,
says Error:KeyError/GUID -->


Thank you for the help,
-Trevor


> -----Original Message-----
> From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Oleg
> Broytmann
> Sent: Thursday, September 06, 2001 12:43 PM
> To: Zope@Zope. Org
> Subject: [Zope] Re: reading a cookie from another PATH??
>
>
> On Thu, Sep 06, 2001 at 12:34:34PM -0400, Trevor Toenjes wrote:
> > How do I control the PATH to read a cookie?
>
>    I do not understand the question.
>
> > I am using
> > <dtml-if "REQUEST.has_key('myCookie')>
> > <dtml-var myCookie>
> > located in www.bar.com/folder1/folder2
>
>    If you setCookie("region", "moscow", path="/foo", domain=".bar.com"),
> the browser will send the cookie along with every request that matches the
> path, in this domain. For example, request to http://www.bar.com/foo will
> set the cookie, as well as for http://foobar.bar.com/foo/bar, but the
> cookie will not be set for request http://www.bar.com/baz/foo
>
> Oleg.
> ----
>      Oleg Broytmann     http://www.zope.org/Members/phd/     phd@phd.pp.ru
>            Programmers don't die, they just GOSUB without RETURN.
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )