[albatross-users] SessionFileAppMixin has no session_age
Michael Barrett
mike at daboyz.org
Thu Jan 30 05:21:11 EST 2003
You're more of a cookie expert than myself it seems :) Anyways, I changed
the code to use this new RFC instead of the old one I was looking at. Makes
it that much cleaner since I don't have to use the time module at all anymore.
### Start DIFF
28c28
< def __init__(self):
---
> def __init__(self, session_ttl=None):
30a31
> self.__session_ttl = session_ttl
62a64,65
> if self.__session_ttl:
> c[self.app.ses_appid()]['Max-Age'] = self.__session_ttl
148c151
< def __init__(self, app):
---
> def __init__(self, app, session_ttl=None):
151c154
< SessionFileContextMixin.__init__(self)
---
> SessionFileContextMixin.__init__(self, session_ttl)
### End DIFF
Thanks again for your help Andrew.
On Wed, Jan 29, 2003 at 09:10:18PM +1100, Andrew McNamara wrote:
> >> if self.__session_ttl:
> >> c[self.app.ses_appid()]['expires'] = time.strftime('%a, %d-%b-%Y %H:%M:%S GMT',time.gmtime(time.time()+self.__session_ttl))
>
> I'm certainly no cookie expert, but the RFC (2109) suggests that Expires
> is the "old way" and that Max-Age should be used instead (which gives
> the cookie age in seconds). I don't know if there are any problems either
> way, although people are forever misparsing date strings, so the Max-Age
> makes more sense.
>
> --
> Andrew McNamara, Senior Developer, Object Craft
> http://www.object-craft.com.au/
> _______________________________________________
> Albatross-users mailing list
> Albatross-users at object-craft.com.au
> https://www.object-craft.com.au/cgi-bin/mailman/listinfo/albatross-users
--
________________________________________________________________________
Mike Barrett | "I used to read, now I go to raves."
mike at daboyz.org | -- Random MUNI Rider, speaking
www.daboyz.org | to my friend Allison.
------------------------+-----------------------------------------------
More information about the Albatross-users
mailing list