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

Clarify session.delete() behavior #189

Open
benatto opened this issue May 6, 2020 · 1 comment
Open

Clarify session.delete() behavior #189

benatto opened this issue May 6, 2020 · 1 comment

Comments

@benatto
Copy link

benatto commented May 6, 2020

Hello,

I was looking at the beaker documentation about session.delete() method. There it says:

"Calling the delete() method deletes the session from the back-end storage and sends an expiration on the cookie requesting the browser to clear it:"

https://beaker.readthedocs.io/en/latest/sessions.html#deleting

However a few lines further we have:

"Removing Expired/Old Sessions

Beaker does not automatically delete expired or old cookies on any of its back-ends. This task is left up to the developer based on how sessions are being used, and on what back-end."

https://beaker.readthedocs.io/en/latest/sessions.html#removing-expired-old-sessions

Looking at the code it indeed seems to no clean-up cookies from any non-transient storage. May I have your help to double check if this is the right behaviour? I mean, on delete()'s documentation it claims it removes the old session/cookies from back-end storage on the other hand "Removing Expired/Old Sessions" states cookies are not deleted from the back-end.

@kotofos
Copy link
Contributor

kotofos commented Sep 24, 2020

As I understand from code, the delete() method does not delete sessions but saves them without values. So it is possible to read them back knowing the ID, but there will be no useful data.
If the session is expired, it is still stored, but with an expired date. Same for old sessions - they will be stored forever.

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

2 participants