Jump to content

accessing a filemaker cookie with PHP...


Batfastad
 Share

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

Recommended Posts

More of a PHP question maybe but...

I think this might be down to what I set the cookie path and domain as but...

We host some databases on the web and the domain is dealer-world.com

We have our main webspace with our host, but also some PHP enabled webspace on a different server at dealerworld.plus.com

I have a couple of cookies set using the FMP-SetCookie CDML command, but I don't use the path or domain options for the cookie.

Is it possible for me to access those cookies from my PHP website, even though the domain is different?

I want to have as few pages running from filemaker as possible, to reduce loads and keep only the actual CDML format pages on our filemaker web server.

What's the PHP syntax I would use to read the value of those cookies??

FileMaker Version: Server 5

Platform: Windows 2000

Link to comment
Share on other sites

Hi, I'm setting cookies in PHP and FMPro and each read and write OK.

Because most web browsers are set to only allow cookies that are read back by the original server, you must set and read them from the same domain. It works OK if you're using different ports for webserver and FMPro.

"What's the PHP syntax I would use to read the value of those cookies" - just the regular php ones, like

if($_COOKIE['mycookie'] == "a value")

or

$myVariable = $_COOKIE['mycookie'];

- I don't think either PHP or FMPro can tell how the cookie's been set

regards, jeff

Link to comment
Share on other sites

Hi, no, any cookie can only be read by the domain that set it. So you can have FMPro and Apache both setting and reading cookies on the same server, but not different ones. Even subdomains (like webserver.mydomain.com and data.mydomain.com) don't work, but "mydomain.com" and "mydomain:591.com" does work and is the way I've used it between php and FMPro.

regards, jeff

Link to comment
Share on other sites

Hi, I tried that and if the domain is not a correct one for that server it errors and does not set.

I think this is a browser security thing and you have to set and read from the same server. Normally, you don't need to specify domain a all as the browser picks it up.

regards, jeff

Link to comment
Share on other sites

This topic is 6475 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
 Share

×
×
  • Create New...

Important Information

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