changeset 5371:437558fff184

Fix FileSessionService - use session_dir from CURRENT request.cfg. It always needs to use the CURRENT request.cfg to get the session_dir for the current wiki's FilesystemSessionStore. Before, the first request in a moin process determined the FilesystemSessionStore for ALL farm wikis processed by that moin process (wrong if they wanted different session_dir).
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Thu, 10 Dec 2009 10:37:12 +0100
parents 6866e80e207b
children 4a406029ad23
files MoinMoin/web/session.py
diffstat 1 files changed, 6 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/web/session.py	Wed Dec 09 21:54:34 2009 +0100
+++ b/MoinMoin/web/session.py	Thu Dec 10 10:37:12 2009 +0100
@@ -70,17 +70,14 @@
     """
     def __init__(self, cookie_name='MOIN_SESSION'):
         self.cookie_name = cookie_name
-        self.store = None
 
     def _store_get(self, request):
-        if self.store is None:
-            path = request.cfg.session_dir
-            try:
-                filesys.mkdir(path)
-            except OSError:
-                pass
-            self.store = FilesystemSessionStore(path=path, filename_template='%s', session_class=MoinSession)
-        return self.store
+        path = request.cfg.session_dir
+        try:
+            filesys.mkdir(path)
+        except OSError:
+            pass
+        return FilesystemSessionStore(path=path, filename_template='%s', session_class=MoinSession)
 
     def get_session(self, request, sid=None):
         if sid is None: