Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Cookie not setting as required

Featured Replies

I have a few records displayed (all on one page) and I am trying to set a cookie based on whatever record the user clicks on. But the cookie is always getting set to a value from the last record displayed, not the one they click on.

The idea is the user clicks the link in a record and it then goes to a page to create a new record in another database, where MyField is pre-filled in. This bit works fine it's just the wrong value pre-filled.

The key part of code in my format file is...

[FMP-record]

<P>

Value of MyField:[FMP-field: MyField].<BR>

<A HREF="FMPro?-db=MyDatabase&-lay=Detail%20Layout&-format=CreateEntry.html[FMP-SetCookie: MyFieldCookie=field:MyField]&-new">Create another record with the same MyField</A>

</P>

[/FMP-record]

I'm using FMP4 Mac, and was avoiding a token because I'm using that for something else. I did try setting the field value within the URL, but this creates a new record before the user has the chance to entered other data!

Thank you if you can help.

  • Author

Just for info on this...

It doesn't work because the Cookie appears to get set regardless of whether the user clicks on the url or not.

In testing I also found setting/reading/setting/reading aCookie on the same page gave unpredictable results.

In the end I used -token and managed to get a cookie working where I originally used the token.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.