
Untitled
By: a guest on
Apr 29th, 2012 | syntax:
None | size: 0.64 KB | hits: 16 | expires: Never
Pyramid: how to check browser cookies support
try: request.headers['Cookie']
except KeyError:
return HTTPFound(location=request.route_url('home'))
WebOb Overview: http://docs.webob.org/en/latest/reference.html
WebOb Class Documentation: http://docs.webob.org/en/latest/modules/webob.html
return HTTPfound( "/path/to/redirect", headers=[ (k,v) for (k,v)
in self.request.response.headers.iteritems() if k == 'Set-Cookie'] )
resp = HTTPFound(location='/path/to/redirect')
return self.request.response.merge_cookies(resp)
delete()
Delete the cookie, and clear the session
invalidate()
Clear the contents and start a new session