second Session Data Manager does not work

Bug #348463 reported by Evgeny Prigorodov
2
Affects Status Importance Assigned to Milestone
Zope 2
Invalid
Low
Chris McDonough

Bug Description

Two (and more) Session Data Manager with different settings does not produce two session objects due to a wrong way of setting their __before_traversal__ hooks.

1) Go to a Zope folder for session data objects (/temp_folder) and create a second Transient Object Container, with ID "long_session_data" for this example. Let's make it not-expiring by setting its data object timeout value to 0.

2) Go to a root Zope folder and create a second Session Data Manager. Bind it to a previously created Transient Object Container at /temp_folder/long_session_data. Assign a unique name for its SESSION object, for example "LONG_SESSION".

3) Now we should have two SESSION objects in a REQUEST: a default expiring one and a newly created LONG_SESSION that should never expire. We planned to use that never expiring sessions for our privileged users.

But SessionDataManager.updateTraversalData() has that problem that is uses a constant hook name in the registerBeforeTraverse() call. So only one registration can win and we may have either SESSION or LONG_SESSION, whatever has been activated last.

Attached is the patch for Zope 2.9.8.

Revision history for this message
Evgeny Prigorodov (eprigorodov) wrote :
Changed in zope2:
assignee: nobody → chrism
Revision history for this message
Andreas Jung (ajung) wrote :

Improper assignment

Changed in zope2:
assignee: chrism → nobody
Revision history for this message
Tres Seaver (tseaver) wrote :

The patch seems sensible, but needs tests.

Changed in zope2:
assignee: nobody → Chris McDonough (chrism-plope)
importance: Undecided → Low
status: New → Triaged
Revision history for this message
Evgeny Prigorodov (eprigorodov) wrote :

OK, here is an additional test ready to include into Products/Sessions/tests/testSessionDataManager.py. Sorry for the style, I was not sure that this second SessionDataManager worth including it into test setup infrastructure.

Revision history for this message
Colin Watson (cjwatson) wrote :

The zope2 project on Launchpad has been archived at the request of the Zope developers (see https://answers.launchpad.net/launchpad/+question/683589 and https://answers.launchpad.net/launchpad/+question/685285). If this bug is still relevant, please refile it at https://github.com/zopefoundation/zope2.

Changed in zope2:
status: Triaged → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.