Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError on session encrypt_key update #60

Closed
FedericoCeratto opened this issue Mar 17, 2014 · 6 comments
Closed

KeyError on session encrypt_key update #60

FedericoCeratto opened this issue Mar 17, 2014 · 6 comments

Comments

@FedericoCeratto
Copy link
Contributor

Hello,
When I restart an application and generate a new encrypt_key without deleting the existing cookies from logged-in browsers I get the following error:

  File "/usr/lib/python2.7/dist-packages/beaker/session.py", line 651, in __getattr__
    return getattr(self._session(), attr)
  File "/usr/lib/python2.7/dist-packages/beaker/session.py", line 644, in _session
    self.__dict__['_sess'] = CookieSession(req, **params)
  File "/usr/lib/python2.7/dist-packages/beaker/session.py", line 531, in __init__
    self['_accessed_time'] > self.timeout:
KeyError: '_accessed_time'

Maybe Beaker should detect this condition and ignore the old cookie, or delete it, or raise a specific exception.
Thanks!

@FedericoCeratto
Copy link
Contributor Author

Bump?

@jon1012
Copy link

jon1012 commented Jul 28, 2014

Same error here, using bottle-cork. It all works well until I change the secret phrase and reload the server.

I then get this exact error until I remove all the cookies from my browser.

@skeetermurphy
Copy link

Simple temporary fix is to edit session.py line 538 to this:
if self.timeout is not None and self.get('_accessed_time', None) is not None and time.time() - \
It's not pretty but it works for now.

skeetermurphy added a commit to skeetermurphy/beaker that referenced this issue Sep 15, 2014
@amol- amol- closed this as completed in 2201b0b Jan 26, 2015
@FedericoCeratto
Copy link
Contributor Author

Any new release planned?

@bbangert
Copy link
Owner

Yes, Beaker is being handed off to @amol- who has been merging PR's lately. I assume he will be crafting a release soon to address some of these open issues.

@amol-
Copy link
Collaborator

amol- commented Jan 27, 2015

I plan to make a bugfix release with those fixes and then switch working to the native python3 support which will lead to the successive major release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants