List Info

Thread: Session problem on upgrade to version 3




Session problem on upgrade to version 3
user name
2007-04-30 18:42:42
I've just done an upgrade to version 3 which is
looking really good so far.

I'm having a fairly urgent problem with the
on_delete_session hooking being missing.

Someone else seems to be having the same issue:
http://www.cherryp
y.org/ticket/678

I'd like to know if this functionality has been
removed and if so any ideas for the best way of fixing
would be appreciated.

Thanks

Andy

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at h
ttp://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Session problem on upgrade to version 3
country flaguser name
United States
2007-04-30 19:13:42
Andrew Veitch wrote:
> I've just done an upgrade to version 3 which is
> looking really good so far.
> 
> I'm having a fairly urgent problem with the
> on_delete_session hooking being missing.
> 
> Someone else seems to be having the same issue:
> http://www.cherryp
y.org/ticket/678
> 
> I'd like to know if this functionality has been
> removed and if so any ideas for the best way of fixing
> would be appreciated.

It's been removed because 1) it's a rare need, and 2) where
to do it
varies with the use case and storage type. Can you describe
your use
case and storage type?

It's *somewhat* easy to add yourself:

from cherrypy.lib import sessions

class MySessionProvider(sessions.FileSession):
    def delete(self):
        do_custom_on_delete_stuff()
        self._delete()

    def clean_up(self):
        do_custom_on_delete_stuff()
        sessions.FileSession.clean_up(self)

cherrypy.lib.sessions.MySessionProvider = MySessionProvider
cherrypy.config.update({'tools.sessions.storage_type':
'MySessionProvider'})

...obviously your "do_custom_on_delete_stuff"
method will have to be
expanded, or be done after the self._delete()/clean_up
calls, or even
inside them if you need to know which entries are being
deleted.


Robert Brewer
System Architect
Amor Ministries
fumanchuamor.org

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at h
ttp://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )