Jump 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.

Help! setting a cookie

Featured Replies

Hi, I'm having trouble trying to make a cookie persist after the end of a session.

I have a very simple line:

[FMP-SETCOOKIE: voter=already voted, EXPIRES=30000]

it sets fine and works, but expires when the browser is closed.

What am I doing wrong??

Your problem raises questions for me. I am not very experienced with cookies aside from I know that they let me re-enter this forum without my having to enter my name and password every visit. They also track other data about my visits.

The premise:

The above is the way cookies work until I clear my cookies, which I do from time to time. When there are no cookies set I must manually enter my name and password to use this forum as a contributor. No big deal. I gather that since no cookies are set the name and password entry is processed by the database and then cookies are again set.

I note Jeff is setting a cookie to show the client has already voted. Now let us assume that the client has voted and subsequently they clear their cookies. Then they return to Jeff's site with no cookies.

The questions:

1. Does the "already voted" issue get verified by the database at the time of re-entry to the site when the client has no cookies set?

2. If question 1 is true, why not just handle this as a database function and not use cookies?

3. If question 1 is false, can the client vote twice?

4. What is done about clients who do not want to accept cookies? I know people like that. Are they penalized?

  • Author

Hi Keith, here's my reasoning behind the cookie:

We want people to go to the site and cast votes for a trade award.

Last year, I captured IP addresses to catch multiple votes from the same computer, but this doesn't work for dial-up accounts, so I was going to set the cookie and pass the value as a hidden field when the new record was made, and use it to pass a new record reply page that tells them they've already voted and then discount that vote in the database.

This works OK and a few smart users who can delete cookies won't really matter for this, but I can't set the expiry time properly as I'm new to FMP-Cookies.

This is a pain as I thought I would crack the whole ******* thing in an afternoon. frown.gif" border="0

regards, Jeff

From previous topic:

We cannot influence mach of what WC is sending to the browsers, can’t we? I am following standard syntax and I always had problems with cookies-FM-WC-MSIE. Not so much in Netscape.

I even redesigned couple of my solutions using cookies to tokens and tokens are 100% reliable.

Oh well, one day....

set the cookie expires to "9999" I have had problems using 5 digits or more.

Tyfud

that is the best tip on cookies! There is a long thread about cookies started by me and not a single idea like yours.

Usually the simplest ideas are the best!

Thanks, I will try it again.

  • Author

Yeeeeeeeees!

It all starts working as soon as I cut down the expiry time.

We might note that the example in the FileMaker CDML reference has a time to die of '43200' crazy.gif" border="0

Thanks, Jeff

Hmmmm. Yet another example from FMI which does not work. Wow. Imagine my surprise. ;-)

I posted to the forums about a year ago asking about this... it was my reason for coming here! I found that any expire value over 44639 minutes makes the cookie go psyco. Unfortunately 44639 minutes is only 31 days which is not enough.

But here's the rub: it only happens on NT. If I hosted the site on MacOS the cookies worked OK. This is FMP 4.0v3.

Thanks Vaughan, that is worth knowing.

Following Vaughan's post.

Even sites serving from Mac have problems in MSIE on PC and not in NN on the same PC.

BTW, John May forum is based on cookies and it is not working for me in MSIE at all. Perfect in Netscape. Served on Mac and Lasso.

Create an account or sign in to comment

Important Information

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

Account

Navigation

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.