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.

Please Help: Unique Cookies

Featured Replies

The cookie I'm setting in the browser is the Client IP.

code:


[FMP-SetCookie: LoginCookie={ClientIP}]

I want the cookie to be a unique, fairly complex I.D. which is hard to guess or figure out.

But I don't want to use calculation fields....

Do you have any ideas?

Thank you! smile.gif" border="0

Maybe concatenate the time to the IP! If you use Javascript you can contrive some complex numbers.

Garry

  • Author
laugh.gif" border="0 thanks... would you be able to explain further? laugh.gif" border="0

This is what I had in mind:

[FMP-SetCookie: mycookie1={ClientIP}{CurrentDate}{CurrentTime}]

However, I had problems including the long version of CurrentTime with the intra tag, hence the seconds were omitted which meant that the value would have a low chance of being unique. Secondly value contents were a bit obvious.

The Javascript version is:

<script>myDate = new Date();document.cooke = "mycookie1=" + myDate.getTime();</script>

This sets the value as an integer representing the date and time in miliseconds. (I removed the i in cookie because this message system did not like the word cookie in a Javascript)

Both versions can have their values recalled with:

[FMP-Cookie: mycookie1]

Note, that if you use the Javascript version you will need to keep the cookie name in lowercase for the FMP tag to read it.

Hope this helps. Garry

  • Author

Thanks a lot Garry! You've been a big help... I'll try it out and see what happens. smile.gif" border="0

Create an account or sign in to comment

Important Information

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

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.