Ducky Posted October 29, 2007 Share Posted October 29, 2007 My boss has asked me to build a php support site which he wants to be able to utilise the cookie from our company's main site for user validation. How do i go about utilising a cookie intended for our other site, or do i need to modify the way cookies are created by the other site to allow for access? Quote Link to comment https://forums.phpfreaks.com/topic/75210-using-a-sister-sites-cookie/ Share on other sites More sharing options...
Dragen Posted October 29, 2007 Share Posted October 29, 2007 I'm quite sure you cant do that unless they're on the same server, because cookies are stored on the server. Quote Link to comment https://forums.phpfreaks.com/topic/75210-using-a-sister-sites-cookie/#findComment-380365 Share on other sites More sharing options...
Ducky Posted October 29, 2007 Author Share Posted October 29, 2007 No, theyre not on the same server. Quote Link to comment https://forums.phpfreaks.com/topic/75210-using-a-sister-sites-cookie/#findComment-380376 Share on other sites More sharing options...
cooldude832 Posted October 29, 2007 Share Posted October 29, 2007 I'm quite sure you cant do that unless they're on the same server, because cookies are stored on the server. No no no. Please make sure you know what you talking about before you say something. Cookies are stored Client Side that means they are on that users computer. However your server can't just start eating all the cookies out there (metaphorically) it can only access cookies that are associated with its domain. Now your question is how to handle this. The simple way to do this is to have the scripts that make cookies on Site A have an intermediate step to make the same cookies associated with site B. Thus the same data is available. Yes its not very clean, but it will work. Sessions are 100% server side, cookies are for the most part client side, some versions of apache have a key log of cookies that can be used similar to a md5 checksum on a file. Quote Link to comment https://forums.phpfreaks.com/topic/75210-using-a-sister-sites-cookie/#findComment-380385 Share on other sites More sharing options...
Dragen Posted October 29, 2007 Share Posted October 29, 2007 yeah sorry. I kinda meant that servers can't get cookies from other servers.. just writing in a hurry Quote Link to comment https://forums.phpfreaks.com/topic/75210-using-a-sister-sites-cookie/#findComment-380394 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.