[mod_python] No expiration datestamp on SessionID cookie

Deron Meranda deron.meranda at gmail.com
Wed Sep 27 17:38:31 EDT 2006


Oops, I made a couple typos...

On 9/27/06, Deron Meranda <deron.meranda at gmail.com> wrote:
>    from mod_python import Cookie
>    import datetime
>
>    now = datetime.datetime.uitcnow()

utcnow, not uitcnow

>    expires = now + datetime.timedelta( 1, 0 ) # 1 day
>    k = Cookie.Cookie( 'sample', 'value', \
>               expires.strftime('%a, %d-%b-%Y %H:%M:%S GMT') )

you need the parameter name, so it should read
        expires=expires.strftime(....)

>   Cookie.add_cookie( req, k )

Deron Meranda


More information about the Mod_python mailing list