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

Ticket #312 (defect)

Opened 3 years ago

Last modified 3 years ago

SessionFilter.beforeFinalize should be changed to onEndResource

Status: closed (fixed)

Reported by: fumanchu Assigned to: rdelon
Priority: high Milestone: 2.1-rc2
Component: CherryPy code Keywords: session filter
Cc:

beforeFinalize is not guaranteed to run for all requests. Specifically, if the RequestHandled? exception is raised, beforeFinalize will not run, and sessions will not currenlty be cleaned up. onEndResource was designed to be the guaranteed-must-run-at-end-of-request method.

Change History

09/20/05 03:27:49: Modified by rdelon

The problem is that sometimes onEndResource is called before the body is consumed (when using HTTP/1.1 and generators) ... And we want to make sure that the session data is saved (and the session locked released) *after* the body is consumed ... So how can we do that ?

09/20/05 10:42:10: Modified by fumanchu

"The problem is that sometimes onEndResource is called before the body is consumed"

...isn't that exactly the same behavior for beforeFinalize?

09/20/05 12:59:02: Modified by rdelon

> isn't that exactly the same behavior for beforeFinalize?

Yes it is, but in beforeFinalize we can wrap the body in another function and add some code that gets executed after the body is consumed ...

A clean way to deal with this would be to add a hook that gets called after the body is consumed

09/27/05 09:59:27: Modified by fumanchu

  • milestone changed from 2.1-final to 2.1-rc2.

10/06/05 11:09:11: Modified by rdelon

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

Fixed in [720]

Hosted by WebFaction

Log in as guest/cpguest to create tickets