Jump to content

Set a cookie in the server


springo

Recommended Posts

There is no server-side cookie in HTML. If you use PHP then you can use sessions. Sessions are stored on the server and not the client. However PHP still sets a cookie that stores a session identifier which PHP uses to serve the correct session when a person visits your site.

I think I didn't make myself clear enough.

I need the server to have that cookie so that a PHP script gets the right file when I use file_get_contents($URL). The other server needs that cookie to provide the file I want. So the server doesn't store a cookie for its script, but rather the one executed on another server when I request the file.

If there are no server-side cookies, can I do this somehow?

Thanks again.

There is no "server side cookie", especially cookies that can shared over multiple sites/servers. You will probably have to create your own simple cookie script for what you want to do.

 

As a side note, I don't know whether this might help but have a look into cURL.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.