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.

Frailty thy name is token

Featured Replies

i set a token using the --- input=hidden name=-token value=[FMP-Field: Name] --- and it works just dandy... Problem is i need the token to work in a link and it's not... It's an auto refresh link, they enter their name and some other info and the next page uses that information to auto forward the user to a different page depending on what they entered in certain fields... we do this using a calculation field in the actual data base and in the code of the page (not the header) we have:

META HTTP-EQUIV="REFRESH" CONTENT="1 ; URL=[FMP-Field: URLRedirect]"

It always redirects just fine... so since now i need to set the token and PASS the token through the redirect, i went to the database and used the following syntax:

http://255.255.255.255/folder/FMPro?-Db=database&-lay=layout&-format=file.htm&-token=[FMP-Field: Name]&-view

The token doesnt get set. It still goes to the right spot but the token becomes "[FMP-Field: URLRedirect]" rather than becoming the value. I've tried it with -edit at the end as well...

Is my syntax just wrong? Again, i set the token successfully on the same redirect page if i use the input type=hidden token tag, but, of course, simply doing that doesnt pass the token...

I dont want to use cookies cause there is talk that they are unstable.

TIA

Jeremy

Hi, I think the problem here is that the redirect is just done at web browser level whilst you need an FMP-action to pass the token.

I share your reservations about Filemaker cookies, but I've usually been able to get an FMpro session cookie to work - they only seem to fall down on some platform/browser combinations when you want to set a persistant one.

regards, jeff

  • Author

it looks as though i am using a FMP-action in my redirect link... that's why i dont understand why it wont pass. (kinda like consti... nevermind) ... the strange thing is that the token doesnt even set in the link in the first place (when i use view source from that page)...

but anyway, we absolutely cant chance a cookie not working... even if the chances are slim. I'm trying to get a javascript cookie to work, but the problems i'm having with that is for a different forum.

any other thoughts or suggestions from Jeff or others?

As Jeff said the -Token assignment is coming too early. A pass through FM is needed to replace the [FMP-Field] tag before the -Token assignment is passed through FM.

Can you set the -Token earlier?

I have done some mixing of CDML and Javascript Cookie coding if you want to have a look at that.

All the best.

Garry

  • Author

well, the token is set before hand and i tested this by using the "-token" tag in the same page that i try to use the link... at any rate, i see this part of the discussion going in circles.

I am very interested in seeing what you have on CDML and javascript cookies. Please contact me or repost to hear and let me know what you got. Thanks much!

Jeremy

Here is how to read, and use, a Cookie called recid with Javascript:

   <script>

var allcookies = document.cookie ;

var pos = allcookies.indexOf("recid=") ;

if (pos != -1) {

var start = pos + 6 ;

var end = allcookies.indexOf(";",start) ;

if (end == -1) end = allcookies.length ;

var value = allcookies.substring(start, end) ; }

else {

var value = 1 ; } ;

</script>

</HEAD>

<BODY BGCOLOR="#FFFFFF">

This is the last page of Course 7. Please read.<br>

<form action="FMPro" method="post">

<input type="hidden" name="-db" value="courses.fp5">

<input type="hidden" name="-lay" value="cgi">

<input type="hidden" name="-format" value="main_.htm">

<input type="hidden" name="course7" value="Completed">

<script>

document.write('<input type="hidden" name="-recid" value="' + value + '">');

</script>

<input type="submit" name="-edit" value="Click here when finished">


Hope this helps.

Garry

Jeremy,

I just re-read your original question.

The &-token=[FMP-Field:name] tag will not be replaced from within an [FMP-Field: URLRedirect] tag. That is, nested tags will not work.

Hope the Cookies work. All the best.

Garry

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.