[Zope] Session transferring problem

Chris McDonough chrism@zope.com
16 Apr 2003 09:32:14 -0400


Hi Lubos,

I unfortunately can't replicate this behavior.

As long as you've got the "automatically encode Zope-generated URLs with
a browser id" parameter checked off in your browser id manager, and as
long as you don't provide *absolute* urls in your links, the URLs
rendered by the browser should indeed include the URL fragments which
identify the session.

OTOH, if you are providing absolute links in the content (links
beginning with a '/' or links that include a protocol like "http://" in
them), the browser will not take into account the base url of the page
and the link will be rendered as written.

Eg:

<a href="testlink">testlink</a>

becomes a link to:

http://localhost:8080/_ZopeId/30629499A0xKIYXTE4A/testlink

<a href="/testlink">absolute testlink</a>

becomes a link to:

http://localhost:8080/testlink

<a href="http://testlink">absolute testlink with protocol</a>

becomes a link to:

http://testlink

If you see something different, please let me know.

- C


On Wed, 2003-04-16 at 08:19, Lubos Culen wrote:
> Hi,
> 
> I have a page with session data transferring through the URLs, so the page
> URLs in browser look like
> http://www.mysite.com/_ZopeId/84525053A0xJuPCpTSI/mydir/mydocument.
> 
> Now, let's have DTML document called "content" inside the "mydocument"
> folder, which contains some "static" HTML data (this data cannot be DTML,
> because it needs to be editable with some WYSIWYG editor). Above these
> folders is some ZPT template called index_html, which will display the
> content data inside the some template.
> Let's have some link in the "mydocument/content" document, which is for
> example <a href="other_document">Link</a> . It is inside the content area
> and it is linked *relatively*, so I suppose it should maintain the session
> data (so the Zope's result URL would be
> http://www.mysite.com/_ZopeId/84525053A0xJuPCpTSI/mydir/other_document ).
> But the reality is bad - result URL is only
> http://www.mysite.com/mydir/other_document and the session data is lost.
> 
> So, the question is, is there *any* way how to maintain URL sessions when
> linking relatively inside plain content (non-DTML and non-ZPT) document in
> Zope? Or, if not, how people use to solve this problem generally, when need
> to transfer non-cookie session data through static <a href="..."> URLs?
> 
> Thanks for the answer,
> 
> Lubos.
> 
> 
> _______________________________________________
> 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 )