cookie
Use cookies to set data in the user's browser that can persist between sessions. The cookie
action allows for setting values into a cookie, and you can use a JavaScript function to retrieve the data back later.
Cookie values can also be retrieved in your FileMaker scripts. They are stored as a JSON object in the $$BF_State variable: JSONGetElement ( $$BF_State ; "params.handshake.headers.cookie" )
Options
action
string
Options: set
and remove
The cookie action to perform. For get
support see examples below
daysOrOptions
number or object
If number, the number of days before the cookie expires, If object see additional notes
name
string
Cookie name
value
string
Cookie value
To remove a cookie simply set the daysOrOptions
value to 0
Examples
There is no built-in custom function at this time. If you want to set a cookie from a FileMaker script, use the BF_SetAction_Function action with the functions above.
Cookies that you set in a browser are will persist for every page in your site (until they expire) and are sent with every hook script back to your FileMaker server. Be careful not to store too much data in cookies as this can impact your site's performance.
For more on reducing the payload that is sent to your FileMaker server, see this page.
Additional Reference:
This action is based on the following Vue modules:
Last updated