Search code examples
urlcookieswebsphereactionportal

WebSphere Portal 8.5 + Action URL + contains cookie value in context path


Recently we upgraded from WPS v7.0 to v8.5. We updated the portlets and few parts of the code to have them compatible and working on the new platform (v8.5). However, we found some peculiar behavior regarding which am looking for some information. Here it goes:

Premise: These portlets use cookies for regions in the form of codes e.g oh for Ohio, ny for New York, etc.

Earlier in WPS v7.0, the portlet action URLs that were generated were of the form:

http://<host>:<port>/wps/portal/!ut/p/b1/04_SjzQ0M.... and so on.

Now, on the new platform (v8.5), the URLs are a little bit different of the below form.

http://<host>:<port>/wps/portal/oh/!ut/p/z1/pZBNCsIwE... (in the case of Ohio)

http://<host>:<port>/wps/portal/ny/!ut/p/z1/pZBNCsIwE... (in the case of New York)

Now coming to peculiar part. The URL on the 8.5 contain the cookie value (in this case: oh for Ohio) as a part of the context.

I traced and checked the logs for the ActionURL tag and other URL implementation classes like BasicURLImpl, BaseURLImpl, PortletURLProviderImpl but have not found any clue on how the cookie value is getting to be part of the action url while it is getting generated.

EDIT: I was able to decode the URL (following this post: WebSphere Portal decode url) and saw that the cookie values are coming up as shared parameters (global) (ref: IBM WebSphere Portal Remote State Service and Fragment Service) which I consider them as public render parameters. Sample excerpt from decode url output here below:

<shared-parameters id="global">
    <shared-parameter nsuri="http://www.ibm.com/xmlns/prod/websphere/portal/publicparams" localpart="path-info">
        <value>oh</value>
    </shared-parameter>
</shared-parameters>

At this point, my opinion is somehow the cookie values are being set as public render parameters but not sure how.

Our goal is not to have the cookie value as a part of the URL. Any clues to settings, configuration or anything that would help in the direction of getting the preferred outcome is appreciated.

Thanks.


Solution

  • After debugging through the actionURL creation, it is observed that the cookie values are being passed as friendly path in the below observed path. As of now, do not have an idea on how these values are being passed as a friendly path.

    PortletURLImpl
        .provider
            .request (PortletRequestWRapper).
                .request(ExtendedLocaleRequest).
                    .request(ExtendedLocaleRequest).
                        .request(FriendlySelectionHttpServletRequestWrapper)
                            .friendlyPath= /oh
                            .contextPath = /wps
                            .originalPathInfo =  /
                            .pathInfo = /
                            .servletPath= /portal
                            .request (MappingURLRequestWrapper)
                                .contextPath = /wps
                                .servletPath= /portal
                                .originalPathInfo = /oh
    

    Finally the issue is now fixed by adding the following property in the WAS admin console:

    Under Resource environment providers > WP ConfigService > Custom properties

    Add the property

    Name: friendly.pathinfo.enabled

    Value: false

    Description: Whether URL mappings and friendly URLs can contain path information to a content item as part of the URL.