Re: Calling Cookie Values

2009-12-16 Thread Victor Subervi
On Tue, Dec 15, 2009 at 4:01 PM, Grant Edwards wrote: > > On Tue, Dec 15, 2009 at 2:36 PM, MRAB > > wrote: > > > > You've just created a cookie, but are trying to get a value without > > having set it first! > > > > > > LOL! Rewrote code thus: > > > >

Re: Calling Cookie Values

2009-12-15 Thread Grant Edwards
> On Tue, Dec 15, 2009 at 2:36 PM, MRAB > wrote: > > You've just created a cookie, but are trying to get a value without > having set it first! > > > LOL! Rewrote code thus: > > cookie = os.environ.get('HTTP_COOKIE') > if not cookie: > cookie

Re: Calling Cookie Values

2009-12-15 Thread Victor Subervi
On Tue, Dec 15, 2009 at 4:05 PM, MRAB wrote: > What you got from HTTP_COOKIE was a _string_ (or None). You then need to > turn it into a cookie: > >cookie_string = os.environ.get('HTTP_COOKIE') >if cookie_string: >cookie = Cookie.SimpleCookie(cookie_string) >... >else:

Re: Calling Cookie Values

2009-12-15 Thread MRAB
Victor Subervi wrote: On Tue, Dec 15, 2009 at 2:36 PM, MRAB > wrote: You've just created a cookie, but are trying to get a value without having set it first! LOL! Rewrote code thus: cookie = os.environ.get('HTTP_COOKIE') if not cookie: cookie

Re: Calling Cookie Values

2009-12-15 Thread Victor Subervi
On Tue, Dec 15, 2009 at 2:36 PM, MRAB wrote: > You've just created a cookie, but are trying to get a value without > having set it first! > LOL! Rewrote code thus: cookie = os.environ.get('HTTP_COOKIE') if not cookie: cookie = Cookie.SimpleCookie() cExpires, cPath, cComment, cDomain

Re: Calling Cookie Values

2009-12-15 Thread MRAB
Victor Subervi wrote: Hi; import Cookie ... cookie = Cookie.SimpleCookie() cookieString = os.environ.get('HTTP_COOKIE') if not cookieString: cExpires, cPath, cComment, cDomain, cMaxAge, cVersion = myCookie() cookie['lastvisit'] = str(time.time()) The following lines aren't going

Re: Calling Cookie Values

2009-12-15 Thread Rami Chowdhury
On Tue, Dec 15, 2009 at 10:05, Victor Subervi wrote: > Hi; > > import Cookie > ... >   cookie = Cookie.SimpleCookie() >   cookieString = os.environ.get('HTTP_COOKIE') >   if not cookieString: [snip] >   else: >     cookieFlag = 'old' >     print cookie['lastvisit']['expires'].value What does cook

Calling Cookie Values

2009-12-15 Thread Victor Subervi
Hi; import Cookie ... cookie = Cookie.SimpleCookie() cookieString = os.environ.get('HTTP_COOKIE') if not cookieString: cExpires, cPath, cComment, cDomain, cMaxAge, cVersion = myCookie() cookie['lastvisit'] = str(time.time()) cookie['lastvisit']['expires'] = cExpires cookie['l