[opencms-dev] Safari and session cookies

Thomas M�rz thomasmaerz at gmx.de
Tue Sep 28 15:51:33 CEST 2004


Daniel Frost <hedhinn at gmail.com> writes:

> Anyone's got a solution to this? I added page session="true" to the
> root redirect jsp, but I haven't yet been able to verify that this
> rectifies the problem.

Patch OpenCms to use javax.servlet.http.HttpServletResponse#encodeURL.

And then dig into org.opencms.file.CmsFile.CmsXmlPageLoader since
patching CmsJspActionElement only appends the jsessionid only to links
within the CmsJspActionElement#link() tag.

So take a look at CmsXmlPageLoader#service.

This was used in OpenCms 5.3.6. In CVS HEAD some things changed.
*This was and is a bad hack.*

| String encodeURL = page.getContent( cms, elementName, locale );
| encodeURL = encodeURL.replaceAll( ".html\"", ".html" +  ( ( CmsFlexResponse ) res ).encodeURL( "asdff" ) + "\"" );
| encodeURL = encodeURL.replaceAll( "asdff", "" );
| result = encodeURL.getBytes( page.getEncoding() );



Index: CmsJspActionElement.java
===================================================================
RCS file:
/usr/local/cvs/opencms/src/org/opencms/jsp/CmsJspActionElement.java,v
retrieving revision 1.10
diff -u -r1.10 CmsJspActionElement.java
--- CmsJspActionElement.java    12 Aug 2004 11:01:30 -0000      1.10
+++ CmsJspActionElement.java    28 Sep 2004 13:41:35 -0000
@@ -352,11 +352,14 @@
      * @see org.opencms.jsp.CmsJspTagLink
      */
     public String link(String link) {
+        String encodeURL = null;
         if (isNotInitialized()) {
             return C_NOT_INITIALIZED;
         }
         try {        
-            return CmsJspTagLink.linkTagAction(link, getRequest());
+            encodeURL = CmsJspTagLink.linkTagAction( link, getRequest()
);
+            encodeURL = getResponse().encodeURL( encodeURL );
+            return encodeURL;
         } catch (Throwable t) {
             handleException(t);
         }  





More information about the opencms-dev mailing list