springo Posted April 30, 2007 Share Posted April 30, 2007 Hi, I'd like to know if it's possible to do this. I mean set it in the server, not in a visitor's browser. Thank you for your help. Link to comment https://forums.phpfreaks.com/topic/49280-set-a-cookie-in-the-server/ Share on other sites More sharing options...
wildteen88 Posted April 30, 2007 Share Posted April 30, 2007 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 https://forums.phpfreaks.com/topic/49280-set-a-cookie-in-the-server/#findComment-241725 Share on other sites More sharing options...
springo Posted April 30, 2007 Author Share Posted April 30, 2007 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 https://forums.phpfreaks.com/topic/49280-set-a-cookie-in-the-server/#findComment-241970 Share on other sites More sharing options...
wildteen88 Posted May 1, 2007 Share Posted May 1, 2007 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 https://forums.phpfreaks.com/topic/49280-set-a-cookie-in-the-server/#findComment-242588 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.