FM BetterForms
BF Editorfmbetterforms.com
1.0 dont use
1.0 dont use
  • Introduction
  • Features Summary
  • Getting Started
    • System Overview
    • Integration
      • 1. Configure FileMaker Server
      • 2. Add your Server to BetterForms
      • 3. Introduction to Hooks
      • 4. Create your first Site
      • 5. Create your first Page
      • 6. Configure your FileMaker File(s)
      • 7. Run your first Hook
      • Next Steps
    • Common Customizations
      • Introduction to Actions
      • Introduction to Buttons
      • Page Navigation
      • Displaying Data in a Table
    • Support
      • Hacking a Webpage
      • Learning JSON
  • Reference
    • Site Settings
      • Navigation
      • Slots / Code Injection
      • App Model
      • Site-wide Named Actions
    • Page Settings
      • Data Model
      • Card / Window Modals
      • Validation
        • Custom Validators
      • Misc Page Settings
    • Page Elements
      • Common
        • Button
        • Data Table
        • HTML
      • Grouping Elements
        • Tabs
        • panel
        • accordion
        • listrows
      • Uploading Files
        • dropzone
        • dropzone to S3
        • uploadCare
      • Misc Elements
        • Plain Text / Code Editor
        • signature
        • fullCalendar
        • rangeSlider
      • Payment Gateways
        • Authorize.net
        • PayPal
        • Stripe
      • Adding Custom Page Elements
    • Actions Processor
      • Named Actions
      • Actions
        • runUtilityHook
        • path
        • debounce
        • throttle
        • showAlert
        • showModal / hideModal
        • function
        • clipboard
        • cookie
        • setFocus
        • wait
        • emit
        • validate
        • channelJoinAnon
        • channelLeaveAnon
        • messageSend
        • messageSendAnonChannel
      • Authentication Actions
    • Script Hooks
      • Globals Variables
        • $$BF_Model
        • $$BF_App
        • $$BF_State
      • Keeping Keys Private
      • Reducing Payload Size
      • API Callback Endpoint
      • Common Hooks
      • Scoped Hooks
    • Users & Authentication
      • Managing User Accounts
      • Custom Login Pages
    • Advanced Configuration
      • Custom Domains
    • BF Utility Functions
    • BF Error Codes
    • Messaging
      • Adding users to channels
      • Removing users from channels
      • Sending messages
      • Get connected users
      • Get active channels
  • Usage Tips
    • Troubleshooting
      • Debugging
      • Frozen Actions Queue
    • JavaScript Tips
      • Calling Named Actions from HTML Vue Events
      • Calculations
    • System Overview
    • Forms Processor
      • Form Types
      • HTML & VueJS
      • Styling and Design
      • JS Caclulations and Functions
    • Customizing and Styling
      • Custom Components
      • Custom CSS
      • Custom Components
      • Page Pre-loaders
      • Favicon
    • Design Patterns and Best Practices
      • Working with environments
      • Handling Data
      • Saving Data
      • Optimization
      • Business Logic
      • UI / UX
  • Security
    • Authentication
    • Security White Paper
    • Firewalls
    • Technology Stack
  • Compatibility
Powered by GitBook
On this page
  • Options
  • Examples
  • Additional Reference:

Was this helpful?

  1. Reference
  2. Actions Processor
  3. Actions

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

Options Key
Type
Description

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

// action  object for 'cookie'
[
  {
    "action": "cookie",
    "options": {
      "action": "set",     // or get or remove
      "daysOrOptions": 1,
      "name": "MyCookieName",
      "value": "my cookie value"
    }
  }
]
// As JS function 
Vue.cookie.set('cookieName', 'some info here', 7);
Vue.cookie.getJSON('cookieName'); // returns JSON obj of cookie data

// Setting a cookie from a click within a HTML 
... @click="Vue.cookie.set('myCookieName', 4)" ...

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.

Additional Reference:

This action is based on the following Vue modules:

PreviousclipboardNextsetFocus

Last updated 3 years ago

Was this helpful?

For more on reducing the payload that is sent to your FileMaker server, see .

this page
GitHub - BlueBayTravel/vue-js-cookie: A Vue plugin for managing cookies.GitHub
GitHub - js-cookie/js-cookie: A simple, lightweight JavaScript API for handling browser cookiesGitHub
Logo
Logo