I am wondering how others have solved this problem. Are people using cookies between the 2 sites (I would like to avoid this) or are people writing this info to a database? Any help would be much appreciated. Thanks, -------- Original Message -------- Subject: [Zope] Sessions between domains Date: Fri, 08 Aug 2003 15:41:47 -0600 From: Ben Bush <ben@center7.com> To: zope@zope.org I have one web server that I am using with zope running on the same box. I want to know how I could transfer session info from one url at www.domain.com to my secure site at secure.domain.com. As far as I can tell, I don't have access to the same session data. This is for a shoppping cart app that would have a user back and forth but I want to maintain the contents of the cart no matter where they may be. Thanks, -- Ben Bush Center 7, Systems Administrator 801-655-2640 _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) -- Ben Bush Center 7, Systems Administrator 801-655-2640
Ben Bush wrote at 2003-8-12 09:13 -0600:
I am wondering how others have solved this problem. Are people using cookies between the 2 sites (I would like to avoid this) or are people writing this info to a database? Any help would be much appreciated.
We serve several domains by the same (farm of) Zope instance. We avoid cookies (mainly because some customers disable them) and code session ids in the URL. Thus, we can transfer session information between domains (in a restricted way only, of course). Dieter
I'm trying to keep around some legacy code, in zope 2.5.1 (CMF 1.3) trying to surround a block with <dtml-with "portal_url.getPortalObject()"> so I reference root level folders. I get the error: Error Type: TALESError Error Value: exceptions.AttributeError on getPortalObject (it's a bit of dtml code in a ZPT page). I've tried a variety of different evaluations, and proxy roles on the dtml method, with basically the same problem. Any idea how to do a dtml-with so you're at the root of a portal (also I'm using VHM)? M
Marc Lindahl wrote:
I'm trying to keep around some legacy code, in zope 2.5.1 (CMF 1.3)
trying to surround a block with <dtml-with "portal_url.getPortalObject()"> so I reference root level folders. I get the error:
Error Type: TALESError Error Value: exceptions.AttributeError on getPortalObject
(it's a bit of dtml code in a ZPT page).
Guh? Do you mean you've put DTML in a ZPT? That's just plain not going to work. You can call DTML Methods from the ZPT, but under no circumstances will mix 'n match work.
I've tried a variety of different evaluations, and proxy roles on the dtml method, with basically the same problem.
Any idea how to do a dtml-with so you're at the root of a portal (also I'm using VHM)?
It's right so far as I can see provided you're in DTML. --jcc -- "My point and period will be throughly wrought, Or well or ill, as this day's battle's fought."
On Friday, November 7, 2003, at 09:11 PM, J. Cameron Cooper wrote:
Marc Lindahl wrote:
Guh? Do you mean you've put DTML in a ZPT? That's just plain not going to work. You can call DTML Methods from the ZPT, but under no circumstances will mix 'n match work.
yes, it was a dtml method called from a ZPT.
I've tried a variety of different evaluations, and proxy roles on the dtml method, with basically the same problem.
Any idea how to do a dtml-with so you're at the root of a portal (also I'm using VHM)?
It's right so far as I can see provided you're in DTML.
yes, it looks OK but it gives me that error!
--jcc
-- "My point and period will be throughly wrought, Or well or ill, as this day's battle's fought."
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Marc Lindahl wrote at 2003-11-7 19:46 -0500:
I'm trying to keep around some legacy code, in zope 2.5.1 (CMF 1.3)
trying to surround a block with <dtml-with "portal_url.getPortalObject()"> so I reference root level folders. I get the error:
Error Type: TALESError Error Value: exceptions.AttributeError on getPortalObject
Almost surely, "portal_url" in not the object you expect. I expect it to be a string in the code above. Note that the "portal_url" object yields a string as soon as it is called. And it is *very* easy to call an object unintentionally both in ZPT and DTML. The code snippet above does not call "portal_url" but something in the context may already have when "portal_url" was bound. -- Dieter
Good point... how the heck to I get around it?? _.getattr('portal_url') or something? On Sunday, November 9, 2003, at 03:22 AM, Dieter Maurer wrote:
Marc Lindahl wrote at 2003-11-7 19:46 -0500:
I'm trying to keep around some legacy code, in zope 2.5.1 (CMF 1.3)
trying to surround a block with <dtml-with "portal_url.getPortalObject()"> so I reference root level folders. I get the error:
Error Type: TALESError Error Value: exceptions.AttributeError on getPortalObject
Almost surely, "portal_url" in not the object you expect. I expect it to be a string in the code above.
Note that the "portal_url" object yields a string as soon as it is called. And it is *very* easy to call an object unintentionally both in ZPT and DTML.
The code snippet above does not call "portal_url" but something in the context may already have when "portal_url" was bound.
-- Dieter
Marc Lindahl wrote at 2003-11-11 11:31 -0500:
Good point... how the heck to I get around it??
First of all, you must find the place where "portal_url" is defined in the wrong way. Only then, can we find out how to work around that.
... On Sunday, November 9, 2003, at 03:22 AM, Dieter Maurer wrote:
Marc Lindahl wrote at 2003-11-7 19:46 -0500: ...
trying to surround a block with <dtml-with "portal_url.getPortalObject()"> so I reference root level folders. I get the error:
Error Type: TALESError Error Value: exceptions.AttributeError on getPortalObject
Almost surely, "portal_url" in not the object you expect. I expect it to be a string in the code above. ...
-- Dieter
On Tuesday, November 11, 2003, at 02:26 PM, Dieter Maurer wrote:
Marc Lindahl wrote at 2003-11-11 11:31 -0500:
Good point... how the heck to I get around it??
First of all, you must find the place where "portal_url" is defined in the wrong way. Only then, can we find out how to work around that.
Wrong way, or accessed such that it returns a string? The latter I have run into before, the string gets cached somehow.... very hard to track down but there was a workaround that I forgot, getattr or something. Thought you'd remember. I don't think portal_url is actually redefined...
Marc Lindahl wrote at 2003-11-12 11:54 -0500:
On Tuesday, November 11, 2003, at 02:26 PM, Dieter Maurer wrote:
Marc Lindahl wrote at 2003-11-11 11:31 -0500:
Good point... how the heck to I get around it??
First of all, you must find the place where "portal_url" is defined in the wrong way. Only then, can we find out how to work around that.
Wrong way, or accessed such that it returns a string? The latter I have run into before, the string gets cached somehow.... very hard to track down but there was a workaround that I forgot, getattr or something. Thought you'd remember. I don't think portal_url is actually redefined...
You are right. Caching would be possible, too. I think, "dtml-var", "dtml-if" and "dtml-in" are caching. I fear, there is no way to access the uncached value through direct use of "_". "_.getitem(name)" would be the way to access "name" without rendering in the first place. But once, it is cached, you will get the cached value. You can try "_.getattr(this(),portal_url)". This way, you use explicite acquisition from the "current object" ("this()") to access "portal_url". -- Dieter
On Wednesday, November 12, 2003, at 04:05 PM, Dieter Maurer wrote:
Marc Lindahl wrote at 2003-11-12 11:54 -0500:
On Tuesday, November 11, 2003, at 02:26 PM, Dieter Maurer wrote:
Marc Lindahl wrote at 2003-11-11 11:31 -0500:
Good point... how the heck to I get around it??
First of all, you must find the place where "portal_url" is defined in the wrong way. Only then, can we find out how to work around that.
Wrong way, or accessed such that it returns a string? The latter I have run into before, the string gets cached somehow.... very hard to track down but there was a workaround that I forgot, getattr or something. Thought you'd remember. I don't think portal_url is actually redefined...
You are right.
Caching would be possible, too. I think, "dtml-var", "dtml-if" and "dtml-in" are caching.
I fear, there is no way to access the uncached value through direct use of "_". "_.getitem(name)" would be the way to access "name" without rendering in the first place. But once, it is cached, you will get the cached value.
You can try "_.getattr(this(),portal_url)". This way, you use explicite acquisition from the "current object" ("this()") to access "portal_url".
That didn't work.... with <dtml-with expr="_.getattr(this(),portal_url)"> I get the error: exceptions.AttributeError on http://www.mysite.com in "standard:'here/homepage_links'", at line 55, column 5 and the same exact error when trying <dtml-with expr="_.getattr(this(),portal_url).getPortalObject()"> This is a good reason to *never* use dtml again! Maybe I'll just rewrite this method in ZPT...
participants (4)
-
Ben Bush -
Dieter Maurer -
J. Cameron Cooper -
Marc Lindahl