Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

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

Posted

Not sure about that.

Would I be able to access them if I moved our PHP platform over to our main domain www.domain.com?

So our cdml pages are served from web.domain.com and our php pages are from www.domain.com?

Would that work? As the domain is domain.com in both cases?

FileMaker Version: Server 5

Platform: Windows 2000

Posted

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

Posted

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

Posted

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

Posted

But what about for subdomains, of the same domain?

As technically the domain is the same! they are hosted on different

servers though.

old.domain.com hosted at our offices, and www.domain.com hosted at our ISP.

Does the browser just pick up domain.com in both cases, or will it pick up www.domain.com and old.domain.com?

Posted

Pants!

That's pretty annoying.

Obviously a limitation or I suppose a security feature of cookies..

Oh well - time to find a work around!

Thanks anyway

This topic is 7508 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.