Commit 33804de4 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

several fixes.

* specify path in setCookie() to avoid sending several duplicated cookies.
* use the normal storage if anonymous storage is not specified.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@38251 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9308adcb
...@@ -280,9 +280,10 @@ class SelectionTool( BaseTool, SimpleItem ): ...@@ -280,9 +280,10 @@ class SelectionTool( BaseTool, SimpleItem ):
""" """
if not selection_name: if not selection_name:
return return
if self._isAnonymous(): anonymous_uid = REQUEST and REQUEST.get('anonymous_uid', None)
self.REQUEST.response.setCookie('anonymous_uid', if anonymous_uid is not None:
self.REQUEST.get('anonymous_uid')) self.REQUEST.response.setCookie('anonymous_uid', anonymous_uid,
path='/')
if selection_object != None: if selection_object != None:
# Set the name so that this selection itself can get its own name. # Set the name so that this selection itself can get its own name.
selection_object.edit(name=selection_name) selection_object.edit(name=selection_name)
...@@ -1464,7 +1465,7 @@ class SelectionTool( BaseTool, SimpleItem ): ...@@ -1464,7 +1465,7 @@ class SelectionTool( BaseTool, SimpleItem ):
def _getContainer(self): def _getContainer(self):
if self._isAnonymous(): if self._isAnonymous():
container_id = '_v_anonymous_selection_container' container_id = '_v_anonymous_selection_container'
storage = self.getAnonymousStorage() storage = self.getAnonymousStorage() or self.getStorage()
else: else:
container_id = '_v_selection_container' container_id = '_v_selection_container'
storage = self.getStorage() storage = self.getStorage()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment