Jump to content
Server Maintenance This Week. ×

detecting a cookie


This topic is 8620 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

Does anyone know if there is a way to detect if a particular cookie has been set in a users browser?

I'm using FMPro 4.1. Users must login to a certain section of a site, on successful login their user id is stored in a cookie. If they leave that section and then return, I want to test if they already have a cookie so that they can bypass the login screen. I don't have any problem setting up two branches using and IF statement, but I can't get filemaker to successfully determine which to go to.

Thanks

Link to comment
Share on other sites

  • 2 weeks later...

Hey G-Man,

This should be how your CDML needs to be configured:

To set your cookie you need this CDML in one of the -Action tags before the user leaves the site:

[FMP-SETCOOKIE: User Has Been Here=Yes, EXPIRES=43200]

Remember, that your expires has to be set to a number longer than the time from when your user will visit again (in minutes). In the example above, 43,200 minutes is approx. one month. If you don't set a cookie "Expires" time, the cookie defaults to expiring immediately.

When the user returns, you need to incorporate the following CDML for your "IF-ELSE" statement:

[FMP-IF: CurrentCookie: User Has Been Here.eq.Yes]

You have been here before.[FMP-ELSE]

You are new. Please login.

[/FMP-IF]

I hope this helps. Let me know if it does.

Jeff

Link to comment
Share on other sites

This topic is 8620 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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