RE: [Zope] Cookies & Expiration
Oops, forgot to send this one to the list... -Original Message- From: Eric Walstad [mailto:[EMAIL PROTECTED]] Sent: Friday, November 03, 2000 3:40 PM To: Steve Drees Subject: RE: [Zope] Cookies & Expiration Hi Steve, Your solution is very cool! I'm going to use it in the following form... (maybe a bit more flexible?, change the default days to suit your needs) ID: expireInNDays Parameter List: self, days=1.0 _BODY__ t = self.ZopeTime() + days # user defined duration t = t.toZone('GMT') return t.strftime("%A, %d-%b-%Y %H:%M:%S GMT") ___ On the page you want to set the cookie put: or, to use the default of 1 day: Thanks -Eric. // -Original Message- // From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Steve // Drees // Sent: Friday, November 03, 2000 2:02 PM // To: Kit O'Connell; [EMAIL PROTECTED] // Subject: RE: [Zope] Cookies & Expiration // // // > However, I'd like to have this cookie set to expire one week // from the date // > of the current visit. i.e., if its 12:30 on 11/3 when a surfer // visits my // > site, I want Zope to set their lastVisited cookie to expire on 12:30 on // > 11/10. // // Have a pythonmethod // // ID expireIn1Week // Parameter List self // _BODY__ // t = self.ZopeTime() + 7.0 # 1 week in the future // t = t.toZone('GMT') // // return t.strftime("%A, %d-%b-%Y %H:%M:%S GMT") // ___ // // // On the page you want to set the cookie put // // // // // // ___ // Zope maillist - [EMAIL PROTECTED] // 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 ) // ___ Zope maillist - [EMAIL PROTECTED] 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 )
RE: [Zope] Cookies & Expiration
On Fri, 3 Nov 2000, Steve Drees wrote: > Have a pythonmethod > > ID expireIn1Week > Parameter List self > _BODY__ > t = self.ZopeTime() + 7.0 # 1 week in the future > t = t.toZone('GMT') > > return t.strftime("%A, %d-%b-%Y %H:%M:%S GMT") It (strftime) is correct as long as you don't use locales. (There's a bug related to this in ZServer/medusa/http_date.py.) [EMAIL PROTECTED] /--\ | `long long long' is too long for GCC | \--/ ___ Zope maillist - [EMAIL PROTECTED] 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 )
RE: [Zope] Cookies & Expiration
> However, I'd like to have this cookie set to expire one week from the date > of the current visit. i.e., if its 12:30 on 11/3 when a surfer visits my > site, I want Zope to set their lastVisited cookie to expire on 12:30 on > 11/10. Have a pythonmethod ID expireIn1Week Parameter List self _BODY__ t = self.ZopeTime() + 7.0 # 1 week in the future t = t.toZone('GMT') return t.strftime("%A, %d-%b-%Y %H:%M:%S GMT") ___ On the page you want to set the cookie put ___ Zope maillist - [EMAIL PROTECTED] 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 )
[Zope] Cookies & Expiration
I'm trying to set up something like is used in the Zope Elvis tutorial, where it sets a cookie to show when you last visited the site, so that I can flag certain articles as 'new'. However, I'd like to have this cookie set to expire one week from the date of the current visit. i.e., if its 12:30 on 11/3 when a surfer visits my site, I want Zope to set their lastVisited cookie to expire on 12:30 on 11/10. Any ideas? Thanks, Kit ___ Zope maillist - [EMAIL PROTECTED] 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 )
Re: [Zope] cookies don't obey me
Roland Reumerman writes: > 1) When I set a cookie with the path set to the root > Be careful with "cookies"! The value of a cookie it quite severely restricted (must not contain many characters; you read the cookie specification?). In your case, the value is not a string at all but a Zope object. "RESPONSE.setCookie" will probably convert the object to a string for you. This will give you "AUTHENTICATED_USER.getUsername()". However, I would feel better, if this would be in your "setCookie" call. Note, that probably Zope user names may contain characters not allowed in Cookie values. > I'm still not able to click through to another hyperlink once I'm logged in, > i.e., I've used www.ddi.nl/support to go the password protected Zope site, > logged in as a customer, and from there I can choose other parts of the site > (below .../support/). However, www.ddi.nl is an alias of > www.datadistilleries.com (the actual name): as a result it asks me for the > password again. I thought setting the path to '/' would convince Zope I'm > authorized, but apparently it's not the case. The path is a "local" path on your server. Setting "path='/'" tells the browser to add the cookie to any request going to your server. "path='/'" would tell the browser to send it only for requests with paths beginning with "/". You cannot control with "path" to what server the cookie is sent. There is the "domain" specification that gives you some control over the servers that get the cookie. I doubt, however, that this mechanism will allow you to send cookies defined by "www.ddi.nl" also to "www.datadistilleries.com". > 2) This might be related to 1. I've created a logout link on the > /support/index_html page, which looks as follows: > > >"RESPONSE.redirect('http://www.datadistilleries.com/support.html?section=m6&envelope=6')"> > However, once I've been redirected I can still access the password protected > /support/ site without Zope asking me for a login name. There must be some magic, you did not yet tell us about. Usually, setting a cookie has nothing to do with password protection or authentication. There must be something like a "login manager" that ties Zope's security subsystem, login/logout and cookies together. Usually, this "login manager" would do the cookie handling transparently. That you are concerned with the cookie seems to indicate that you implement your own "login manager"? The built in Zope authentication does not use cookies at all but "basic authentication" as defined by HTTP. Dieter ___ Zope maillist - [EMAIL PROTECTED] 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 )
[Zope] cookies don't obey me
I've been experiencing two problems with cookies from Zope: 1) When I set a cookie with the path set to the root I'm still not able to click through to another hyperlink once I'm logged in, i.e., I've used www.ddi.nl/support to go the password protected Zope site, logged in as a customer, and from there I can choose other parts of the site (below .../support/). However, www.ddi.nl is an alias of www.datadistilleries.com (the actual name): as a result it asks me for the password again. I thought setting the path to '/' would convince Zope I'm authorized, but apparently it's not the case. 2) This might be related to 1. I've created a logout link on the .../support/index_html page, which looks as follows: http://www.datadistilleries.com/support.html?section=m6&envelope=6')"> However, once I've been redirected I can still access the password protected .../support/ site without Zope asking me for a login name. Now, I'm not 'cookie guru', so please don't tell me how stupid it is of me that I didn't think of this or that to make it work. I did do my background research homework though! Thanks for reading this far ;-). RCR _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. Share information about yourself, create your own public profile at http://profiles.msn.com. ___ Zope maillist - [EMAIL PROTECTED] 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 )
Re: [Zope] cookies
http://www.zope.org/Members/BwanaZulia/cookies/index_html That should help. J > From: "Vincent Maton" <[EMAIL PROTECTED]> > Date: Tue, 4 Jul 2000 15:45:55 +0200 > To: "Zope" <[EMAIL PROTECTED]> > Subject: [Zope] cookies > > Hello !!! > can you tell me how can I use the "cookies" > > Thank you very much > > > ___ > Zope maillist - [EMAIL PROTECTED] > 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 ) > > ___ Zope maillist - [EMAIL PROTECTED] 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 )
Re: [Zope] cookies
Hi Vincent ! Vincent Maton schrieb: > > Hello !!! > can you tell me how can I use the "cookies" Just go to the following page: http://zdp.zope.org/portals/developers/sessionmanagement/cookies If you find another resource that we have overlooked, please add it yourself on this page. People can then see your contribution on the following page, which lists all things that change or have been added to the ZDP site: http://zdp.zope.org/SearchLastChanged/ Best regards, Maik Röder ___ Zope maillist - [EMAIL PROTECTED] 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 )
Re: [Zope] cookies
>can you tell me how can I use the "cookies" try: no blurk today Also see the relevant portion of the DTML reference guide http://www.zope.org/Documentation/Guides/DTML-HTML/DTML.4.5.html#pgfId-10470 78 and the dtml-snippet http://zdp.zope.org/projects/zsnippet/snippets/ClientServerInteraction/SetCo okie Rik ___ Zope maillist - [EMAIL PROTECTED] 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 )
[Zope] cookies
Hello !!! can you tell me how can I use the "cookies" Thank you very much ___ Zope maillist - [EMAIL PROTECTED] 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 )
Re: [Zope] Cookies
> > )"> > Try: > Regards, Stephan -- Stephan Richter CBU - Physics and Chemistry Web2k - Web Design/Development & Technical Project Management ___ Zope maillist - [EMAIL PROTECTED] 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 )
Re: [Zope] Cookies
On Thu, 25 May 2000, Mabe, Brad wrote: > )"> Inside double quotes there is Python, not DTML: Oleg.(All opinions are mine and not of my employer) Oleg Broytmann Foundation for Effective Policies [EMAIL PROTECTED] Programmers don't die, they just GOSUB without RETURN. ___ Zope maillist - [EMAIL PROTECTED] 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 )
RE: [Zope] Cookies
> -Original Message- > From: Mabe, Brad [mailto:[EMAIL PROTECTED]] > Sent: 25 May 2000 16:29 > To: '[EMAIL PROTECTED]' > Subject: [Zope] Cookies > > I am trying to create a cookie based on the value returned from a sql > method. The following code fails with an invalid syntax error. > > > )"> > Hi, Inside quotation marks, you're writing python, so makes the parser barf. cntry_cd is pushed onto the namespace by the , so you can simply use: Note also the slash in the closing . hth, -- Marcus ___ Zope maillist - [EMAIL PROTECTED] 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 )
Re: [Zope] Cookies
At 10:28 am -0400 25/5/00, Mabe, Brad wrote: >I am trying to create a cookie based on the value returned from a sql >method. The following code fails with an invalid syntax error. > > > )"> > > should work hth tone -- Dr Tony McDonald, FMCC, Networked Learning Environments Project http://nle.ncl.ac.uk/ The Medical School, Newcastle University Tel: +44 191 222 5888 Fingerprint: 3450 876D FA41 B926 D3DD F8C3 F2D0 C3B9 8B38 18A2 ___ Zope maillist - [EMAIL PROTECTED] 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 )
[Zope] Cookies
I am trying to create a cookie based on the value returned from a sql method. The following code fails with an invalid syntax error. )"> Any guidance will be greatly appreciated -=Brad=- ___ Zope maillist - [EMAIL PROTECTED] 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 )