Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Ticket #525 (defect)

Opened 2 years ago

Last modified 2 years ago

Support Deleting Sessions

Status: closed (fixed)

Reported by: jvanasco@gmail.com Assigned to: rdelon
Priority: high Milestone:
Component: CherryPy code Keywords: session expire
Cc:

There's no support to delete sessions right now.

One can delete information IN the session, but not the session itself.

Deleting the session itself is useful/required if you're tracking things against the session.

there should be a function like this (postgres implementation)

def delete( self , id):
    self.cursor.execute(
            'delete from session where id=%s',
            (id,))
   cookie_name = conf('session_filter.cookie_name', 'session_id')
   cookie = cherrypy.response.simple_cookie
   # cookie expires 1 year ago, because browser clocks are stupid.   it would be best if they expire @epoch, but some browsers don't like that
   gmt_expiration_time = time.gmtime(time.time() - ( 60 * 60 * 24 * 365 ))
   cookie[cookie_name]['expires'] = time.strftime(
                "%a, %d-%b-%Y %H:%M:%S GMT", gmt_expiration_time)

Change History

05/30/06 22:23:36: Modified by mikerobi

It isn't exactly what you are looking for, but you can force a session to expire by setting the expiration time to 0.

08/26/06 21:14:52: Modified by fumanchu

  • status changed from new to closed.
  • resolution set to fixed.

Fixed in [1287]. The deletion of the session data (cherrypy.session.delete) is separated from the expiration of the cookie (cherrypy.lib.sessions.expire).

Hosted by WebFaction

Log in as guest/cpguest to create tickets