Custom Web Publishing with XML and XSLT

Table Of Contents
64 FileMaker Server Custom Web Publishing with XML and XSLT
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 Admin
Console. See FileMaker
Server Help.
Note This function requires the <?xslt-cwp-buffer?>
processing instruction. See
“Using content
buffering” on page 63.
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 seconds.
The default timeout for sessions is set via the Admin
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.
fmxslt:set_session_object(String
session-name, String name, Object value)
XSLT object
(number, string,
boolean, or
node-set)
Stores an XSLT object (a number, string, boolean, or
node-set) under a session, which can be later retrieved
using the fmxslt:get_session_object () function.
This function also returns the previously stored object
under the specified session object name. If nothing
was stored under the name, it returns a null object.
Note The set_session_object() extension function
stores string values only; it interprets any object
passed to it as a string. If the object cannot be
converted to a string, then no value is stored in the
session and the extension function error code is set
to 10100 (Unknown Session Error). If you attempt
to set a session object using null or an empty string,
you also receive an error code of 10100 (Unknown
Session Error). To clear out a session variable,
remove the variable from the session using the
remove_session_object() function.
fmxslt:get_session_object(String
session-name, String name)
XSLT object Retrieves an XSLT object from the session.
fmxslt:remove_session_object(String
session-name, String name)
XSLT object Returns and then removes an XSLT object from the
session.