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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.