Custom Web Publishing Guide

Table Of Contents
Developing FileMaker XSLT stylesheets 59
By default, the Web Publishing Engine will use a cookie to store the session ID. To accommodate clients that
do not allow cookies, you can use the
fmxslt:session_encode_url() function to add the Session ID to the URL.
To guarantee compatibility in all situations, it is recommended that you encode all URLs written out to the
page with the
fmxslt:session_encode_url() function. This function adds to your URL a semicolon-separated
parameter called
jsessionid, which is the identifier for the particular client’s parent session.
For example, instead of placing the following link on a page:
<a href="my_stylesheet.xsl?-db=products&-lay=sales&-grammar=fmresultset&-findall">hyperlinked text</a>
You should encode all links on a page as follows:
<a href="{fmxslt:session_encode_url('my_stylesheet.xsl?-db=products&-lay=sales&-grammar=fmresultset&-findall')}">
hyperlinked text</a>
If the client does not allow cookies, the page includes:
<a href="my_stylesheet.xsl;jsessionid=<session id>?-db=products&-lay=sales&-grammar=fmresultset&-findall">
hyperlinked text</a>
If the Web Publishing Engine detects that the client allows cookies, then the fmxslt:session_encode_url()
function stores the session ID in a cookie instead of the URL.
Note Session information does not persist after the Web Publishing Engine is restarted.
Using the session extension functions
Use the following session extension functions to manipulate session variables. You can store a string, number,
boolean value, or node-set in a session object. By using node-set, you can create a data structure in XML and
then store it between requests in the session object.
Session extension function
Data type
returned Description
fmxslt:session_exists(String session-name) boolean Checks if a session with the specified name exists.
fmxslt:create_session(String session-name) boolean Creates a session with the specified session name
and the default time-out, which is set via the
Administration Console. See the FileMaker
Server Advanced Web Publishing Installation
Guide.
Note This function requires the <?xslt-cwp-
buffer?> processing instruction. See “Using
content buffering” on page 58.
fmxslt:invalidate_session(String
session-name)
boolean Forces the session to time out immediately.
fmxslt:set_session_timeout(String
session-name, Number timeout)
boolean Sets the session timeout in minutes.
The default timeout for sessions is set via the
Administration Console.
fmxslt:session_encode_url(String url) string Encodes a URL with the session ID if the client
does not support cookies; otherwise returns input
URL.