Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Anyone got set_cookie() to work?


This topic is 7099 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Using fmxslt:set_cookie (String name, String value) works just fine. However, using the other set_cookie function -- fmxslt:set_cookie (String name, String value, Number expires, String path, String domain) -- does not work. Not even the examples given in the XSLT Reference work!

Example:

<xsl:variable name="storing_cookie" select="fmxslt:set_cookie ('foo', 'bar', 1800, 'my_cookie', 'yourdomain.com') "/>

Has the syntax changed? Is there an errata out there? Did anyone manage to use the latter set_cookie function?

Thanks,

Adrien

Posted

Cookies run fine on our solution.

The problem is your 4th parameter. It must be a path.

<xsl:variable name="storing_cookie" select="fmxslt:set_cookie ('foo', 'bar', 1800, 'my_cookie', 'yourdomain.com') "/>

must be changed to

<xsl:variable name="storing_cookie" select="fmxslt:set_cookie ('foo', 'bar', 1800, '/fmi/xsl', 'yourdomain.com') "/> or the path where your XSLT file resides in (e.g. '/fmi/xsl/subpath/subsubpath')

The format has indeed changed for reading out the cookie - cookies are now node sets. Look at the Readme file that came with the WPE v3 Updater.

Posted

Thanks again Martin!

I was suspecting it... I really thought 'my_cookie' would be automatically added to the path.

Thanks for the help,

Adrien

This topic is 7099 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.