[Zope] cookies + zpt

Jos van der Vleuten Jos.van.der.Vleuten@transiciel.nl
Wed, 2 Apr 2003 16:21:07 +0200


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>cookies + zpt</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2 FACE="Arial">hello list,</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">I want to use something like the Zope tutorial lesson 9 in ZPT, </FONT>
<BR><FONT SIZE=2 FACE="Arial">but i don't now how to do this. Any suggestions?</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">&lt;dtml-call expr=&quot;RESPONSE.setCookie('lastVisited', _.DateTime())&quot;&gt;</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">&lt;dtml-comment&gt;</FONT>
<BR><FONT SIZE=2 FACE="Arial">If this is their first time here set a default value</FONT>
<BR><FONT SIZE=2 FACE="Arial">for lastVisited, since they won't have the cookie yet.</FONT>
<BR><FONT SIZE=2 FACE="Arial">&lt;/dtml-comment&gt;</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">&lt;dtml-unless lastVisited&gt;</FONT>
<BR><FONT SIZE=2 FACE="Arial">&nbsp; &lt;dtml-call &quot;REQUEST.set('lastVisited','1999/01/01')&quot;&gt;</FONT>
<BR><FONT SIZE=2 FACE="Arial">&lt;/dtml-unless&gt;</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">&lt;h2&gt;&lt;dtml-var title&gt;&lt;/h2&gt;</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">&lt;dtml-in &quot;sightingsFolder.objectValues()&quot;&gt;</FONT>
<BR><FONT SIZE=2 FACE="Arial">&lt;dtml-if expr=&quot;bobobase_modification_time() &gt; _.DateTime(lastVisited)&quot;&gt;</FONT>
<BR><FONT SIZE=2 FACE="Arial">&lt;b&gt;New&lt;/b&gt;</FONT>
<BR><FONT SIZE=2 FACE="Arial">&lt;/dtml-if&gt;</FONT>
<BR><FONT SIZE=2 FACE="Arial">&lt;dtml-var sequence-item&gt;</FONT>
<BR><FONT SIZE=2 FACE="Arial">&lt;/dtml-in&gt;</FONT>
</P>
<BR>

<P><FONT SIZE=2 FACE="Arial">cheers,</FONT>
<BR><FONT SIZE=2 FACE="Arial">Jos van der Vleuten</FONT>
</P>
<BR>
<BR>
<BR>
<BR>

</BODY>
</HTML>