[Zope-Checkins] CVS: Zope2 - CopySupport.py:1.63.4.8
Brian Lloyd
brian@digicool.com
Mon, 16 Apr 2001 12:26:21 -0400 (EDT)
Update of /cvs-repository/Zope2/lib/python/OFS
In directory korak:/home/brian/temp/zope-23-branch/lib/python/OFS
Modified Files:
Tag: zope-2_3-branch
CopySupport.py
Log Message:
Tweaked clipboard cookie path to be VH aware (use BASEPATH)
--- Updated File CopySupport.py in package Zope2 --
--- CopySupport.py 2001/03/27 14:48:16 1.63.4.7
+++ CopySupport.py 2001/04/16 16:26:20 1.63.4.8
@@ -144,7 +144,7 @@
cp=_cb_encode(cp)
if REQUEST is not None:
resp=REQUEST['RESPONSE']
- resp.setCookie('__cp', cp, path='%s' % REQUEST['SCRIPT_NAME'])
+ resp.setCookie('__cp', cp, path='%s' % cookie_path(REQUEST))
REQUEST['__cp'] = cp
return self.manage_main(self, REQUEST)
return cp
@@ -169,7 +169,7 @@
cp=_cb_encode(cp)
if REQUEST is not None:
resp=REQUEST['RESPONSE']
- resp.setCookie('__cp', cp, path='%s' % REQUEST['SCRIPT_NAME'])
+ resp.setCookie('__cp', cp, path='%s' % cookie_path(REQUEST))
REQUEST['__cp'] = cp
return self.manage_main(self, REQUEST)
return cp
@@ -267,7 +267,7 @@
if REQUEST is not None:
REQUEST['RESPONSE'].setCookie('__cp', 'deleted',
- path='%s' % REQUEST['SCRIPT_NAME'],
+ path='%s' % cookie_path(REQUEST),
expires='Wed, 31-Dec-97 23:59:59 GMT')
REQUEST['__cp'] = None
return self.manage_main(self, REQUEST, update_menu=1,
@@ -524,6 +524,10 @@
def _cb_decode(s):
return loads(decompress(unquote(s)))
+def cookie_path(request):
+ # Return a "path" value for use in a cookie that refers
+ # to the root of the Zope object space.
+ return request['BASEPATH1'] or "/"