Quantcast
Channel: C1 CMS Foundation - Open Source on .NET
Viewing all articles
Browse latest Browse all 2540

New Post: A Cookie Problem - Using Composite.Web.Request.CookieValue with functions displays someone else's data

$
0
0
I have a cookie problem in C1 v4.2.

Our course cookie holds user-selected variables and is set via client-side JavaScript. If User A selects course1 and course2, these are stored as a string in their browser's "course-memory" cookie as "course1,course2". Likewise User B selects course3 and course4, and they are store in their browser's "course-memory" cookie as "course3,course4".

I now have an XSLT function that checks the cookie using:
<functions>
    <f:function xmlns:f="http://www.composite.net/ns/function/1.0" name="Composite.Web.Request.CookieValue" localname="CookieValue">
        <f:param name="CookieName" value="course-memory" />
    </f:function>
</functions>
... and then takes the cookie variables, splits them at the comma and outputs them in separate table rows on a page. At least, that is what is supposed to happen.

In reality, User A is seeing User B's variables whenever User B updates their cookie after User A has done so.

I think the XSLT function is treating the imported cookie string like an application variable and not a distinct session variable, and so is overwriting the value in memory every time it sees the cookie changing.

Is there a way to make the XSLT function work uniquely for each user?

Viewing all articles
Browse latest Browse all 2540

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>