Re: Calling Cookie Values

2009-12-16 Thread Victor Subervi
On Tue, Dec 15, 2009 at 4:01 PM, Grant Edwards inva...@invalid.invalidwrote: On Tue, Dec 15, 2009 at 2:36 PM, MRAB pyt...@mrabarnett.plus.com mailto:pyt...@mrabarnett.plus.com wrote: You've just created a cookie, but are trying to get a value without having set it first!

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

Re: Calling Cookie Values

2009-12-15 Thread Rami Chowdhury
On Tue, Dec 15, 2009 at 10:05, Victor Subervi victorsube...@gmail.com 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

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 Victor Subervi
On Tue, Dec 15, 2009 at 2:36 PM, MRAB pyt...@mrabarnett.plus.com 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,

Re: Calling Cookie Values

2009-12-15 Thread MRAB
Victor Subervi wrote: On Tue, Dec 15, 2009 at 2:36 PM, MRAB pyt...@mrabarnett.plus.com mailto:pyt...@mrabarnett.plus.com 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')

Re: Calling Cookie Values

2009-12-15 Thread Victor Subervi
On Tue, Dec 15, 2009 at 4:05 PM, MRAB pyt...@mrabarnett.plus.com 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)

Re: Calling Cookie Values

2009-12-15 Thread Grant Edwards
On Tue, Dec 15, 2009 at 2:36 PM, MRAB pyt...@mrabarnett.plus.com mailto:pyt...@mrabarnett.plus.com 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