[CherryPy] #767: Replace sessions.py with something good

2 views
Skip to first unread message

CherryPy

unread,
Jan 13, 2008, 8:36:54 PM1/13/08
to cherrypy...@googlegroups.com
#767: Replace sessions.py with something good
---------------------------+------------------------------------------------
Reporter: fumanchu | Owner: rdelon
Type: defect | Status: new
Priority: normal | Milestone:
Component: CherryPy code | Keywords:
---------------------------+------------------------------------------------
The session library in CP isn't very good: it's hard to extend, partly
because IMO it tries to do too much. For example, it shouldn't try to
allow both eager and lazy locking. It also does too much at the class
level instead of the instance level; that is, instead of instantiating a
Session object per request, it should just stick all that state into
cherrypy.request--it would then be free to instantiate a FileSession
object per Application, rather than using class variables to manage config
across requests.

--
Ticket URL: <http://www.cherrypy.org/ticket/767>
CherryPy <http://www.cherrypy.org>
CherryPy - a pythonic, object-oriented HTTP framework

CherryPy

unread,
Jan 13, 2008, 8:57:06 PM1/13/08
to cherrypy...@googlegroups.com
#767: Replace sessions.py with something good
---------------------------+------------------------------------------------
Reporter: fumanchu | Owner: fumanchu
Type: defect | Status: assigned
Priority: normal | Milestone:
Component: CherryPy code | Resolution:
Keywords: |
---------------------------+------------------------------------------------
Changes (by fumanchu):

* owner: rdelon => fumanchu
* status: new => assigned

Comment:

It might also be good to move {{{cherrypy.session}}} to
{{{cherrypy.request.session}}}. This would make it clear that the session
is serving-scoped, and also simplify the implementation (by removing the
{{{_ThreadLocalProxy}}}). Another solution would be to just ditch the
proxy and go with {{{cherrypy.serving.session}}} (which the implementation
already uses anyway).

CherryPy

unread,
Jul 9, 2008, 1:54:41 PM7/9/08
to cherrypy...@googlegroups.com
#767: Replace sessions.py with something good
-------------------------+--------------------------------------------------
Reporter: fumanchu | Owner: fumanchu
Type: enhancement | Status: assigned
Priority: normal | Milestone:
Component: sessions | Resolution:
Keywords: |
-------------------------+--------------------------------------------------
Changes (by nick125):

* type: defect => enhancement

--
Ticket URL: <http://cherrypy.org/ticket/767>

CherryPy

unread,
Jul 17, 2011, 9:20:53 AM7/17/11
to cherrypy...@googlegroups.com
#767: Replace sessions.py with something good
-------------------------+--------------------------------------------------
Reporter: fumanchu | Owner: fumanchu
Type: enhancement | Status: assigned
Priority: normal | Milestone:
Component: sessions | Resolution:
Keywords: |
-------------------------+--------------------------------------------------
Comment (by guest):

As this sounds like a huge overhaul of Sessions is planned, i wanted to
make a suggestion: Many things, that those subclasses of
cherrypy.lib.sessions.Session do, are things that would fit perfectly in a
seperate interface. As many people are familiar with the python-memcached
API, i want to peopose a CacheInterface layer to provide just that.

The problem with MemcachedSession (and Session) is, that it does many
things that memcached already does, like taking care about expiration. In
the current state, whether a session is expired or not, is always tested
twice.

The file I attached is not meant as a patch, but as an proof-of-concept,
e.g. DatabaseCache is meant to make use of an abstraction-layer like
SqlAlchemy/Storm/etc (in this case I use a hand-crafted one).

I would be happy to hear any thoughts on this.
Reply all
Reply to author
Forward
0 new messages