circuits.web.Sessions should have an expire method #133

Open
mnlipp opened this Issue Oct 2, 2015 · 3 comments

Projects

None yet

3 participants

@mnlipp
Contributor
mnlipp commented Oct 2, 2015

The policy, when to expire a session, is, of course, application dependent. But Sessions should have a method expire(session) that removes the session from the dict. Currently, you have to access the Sessions object's _data attribute, which violates the python conventions.

As an alternative, the class' comment could point out that sessions don't expire and encourage users to develop and use session managers derived from Sessions that implement a policy for expiration (and can access _data "legally", depending on whether you consider an _attribute in python private or protected). Of course, from a designer's point of view, it would still be better to provide a method.

@prologic
Member
prologic commented Oct 2, 2015

Seems like adding .expire() would be a good idea :)

Solidifying a base class and API for all derived session management would
be good :)

Let's add this as a new issue; seems it would be trivial to add this?

cheers
James

James Mills / prologic

E: prologic@shortcircuit.net.au
W: prologic.shortcircuit.net.au

On Fri, Oct 2, 2015 at 3:22 AM, mnlipp notifications@github.com wrote:

The policy, when to expire a session, is, of course, application
dependent. But Sessions should have a method expire(session) that removes
the session from the dict. Currently, you have to access the Sessions
object's _data attribute, which violates the python conventions.

As an alternative, the class' comment could point out that sessions don't
expire and encourage users to develop and use session managers derived from
Sessions that implement a policy for expiration (and can access _data
"legally", depending on whether you consider an _attribute in python
private or protected). Of course, from a designer's point of view, it would
still be better to provide a method.


Reply to this email directly or view it on GitHub
#133.

@prologic prologic added the enhancement label Oct 2, 2015
@prologic prologic added this to the 3.2 milestone Oct 2, 2015
@prologic prologic added the ready label Oct 3, 2015
@prologic prologic modified the milestone: 3.2, 3.3 Jun 2, 2016
@eriol
Member
eriol commented Jul 24, 2016

@mnlipp you were talking about something like this a0bdf7e? Only exposing a method to not use _data directly, or something more/different?

@mnlipp
Contributor
mnlipp commented Jul 24, 2016

Yes, this is all I meant to address.

@prologic prologic added a commit that referenced this issue Jan 23, 2017
@prologic prologic [web]: Improve the API for session management and add expire support.
Fixes #133
5772548
@prologic prologic self-assigned this Jan 23, 2017
@prologic prologic added in progress and removed ready labels Jan 23, 2017
@prologic prologic added a commit that referenced this issue Jan 23, 2017
@prologic prologic [web]: Improve the API for session management and add expire support.
Fixes #133
1b72fad
@prologic prologic added a commit that referenced this issue Jan 29, 2017
@prologic prologic [web]: Improve the API for session management and add expire support.
Fixes #133
050fc48
@prologic prologic added a commit that referenced this issue Jan 29, 2017
@prologic prologic [web]: Improve the API for session management and add expire support.
Fixes #133
1cfe87c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment