Matt Feifarek wrote:
> I'm starting to use Webkit.Cookie and I'm frustrated that the
> expires method
> only takes a string, rather than a python date/time float.
> Of course one can use time.time() and some string
> substitution etcetera to
> accomplish the same thing, but it would be nice to have
> capabilities like...
> chocolateChip.setExpires( time.time() ) # expires a cookie now
> chocolateChip.setExpires( time.time() + 30*24*60*60 ) #
> expires a cookie in
> 30 days
I would also like it to allow mxDateTime objects. But it still needs to
work even if mxDateTime isn't installed.
> it might be even nicer if one could do something like this:
> chocolateChip.setExpires( "+1w" ) # expires a cookie one
> week from now
> chocolateChip.setExpires( "+240s" ) # expires a cookie 240
> seconds from now
> chocolateChip.setExpires( 0 ) # expires a cookie now (in the past)
Might be better to somehow use keyword arguments instead of hard-to-remember
> I would be happy to change this code and submit it for
> inclusion if there is
> interest. I don't know what the formal submission procedures are.
I just added this page to the Wiki: