[Zope] Cookie pointer.

TMGB bennettt@am.appstate.edu
Mon, 25 Sep 2000 13:00:24 -0400


Since cookies have been brought up, I tried the following code (Using
Steve's example):


<dtml-if expr="RESPONSE.setCookie('name', 'value', path='/', expires=(
ZopeTime() + (1.0/102.0) )">
         "You have cookies enabled"
<dtml-else>
  "Your browser does not support cookies"
</dtml-if>


The cookie gets set and the text that displays is from the else part, so
the cookie is set and I tell the user their browser doesn't support
cookies. 

1. I want to know if the user's browser supports cookies.

I am getting ready to develop a help page for people using our proxy
server and I need to add their browser capabilities to a database and
respond to the user the settings they have in a "layman" terminology.  I
plan on putting in a <dtml-call> on each side of the else that will
update the database.  I am also looking at <dtml-var REQUEST> which
gives me information I need.  I have searched the Zope Site and cannot
find help on this.  

2. Can I display individual parts of the the REQUEST results or do I
have to parse the results in an external method using python?

3. And then on another topic, can I create a product from a directory
tree in my Zope Server or do I have to create a product from the
beginning majorly because of the syntax used in creating a product?

TIA

Thomas

Steve Drees wrote:
> 
> I learned this one the hard way.
> 
> Had a python method
> id: expireTime
> parameters: self
> body:
> t = self.ZopeTime() + (1.0/192.0) # 7.5 minutes in the future
> t = t.toZone('GMT')
> 
> return t.strftime("%A, %d-%b-%Y %H:%M:%S GMT")
> ------------------------------------------------------
> 
> Was trying the following
> 
> <dtml-call "RESPONSE.setCookie('name', 'value', path='/',
> expires=expireTime)">
> 
> This does NOT work.
> 
> THe following works MUCH better
> 
> <dtml-call "RESPONSE.setCookie('name', 'value', path='/',
> expires=expireTime())">
> 
> --
> Steve Drees
> SysAdmin/Software Developer/Web Geek/Chief Bottle Washer
> "A problem well-stated is a problem half-solved."
> http://www.christianmp3zone.com/savanna
> 
> _______________________________________________
> 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 )

-- 
--------------------------------------------------------------------
                      Rock and Rule
             Zope Rocks -- http://www.zope.org
           Python Rules  -- http://www.python.org    
--------------------------------------------------------------------
Thomas McMillan Grant Bennett      Appalachian State University
Computer Consultant III            University Library
bennettt@am.appstate.edu          
http://www.library.appstate.edu/webmaster/
Voice:  828 262 6587	           FAX:    828 262 3001

Windows 95 is a 32-bit extension to a 16-bit patch for an 8-bit
operating system that was originally coded for a 4-bit microprocessor.
 - Chris Dunphy     Boot Magazine