scanf Posted September 30, 2010 Share Posted September 30, 2010 i'm using php as a middle layer to hit a web api for an ajax front end. this web api sets and reads cookies upon each call after a successful authenticated login, so i needed a way to simulate this since this request isn't being made from a browser, but a web server. the problem here is the use of curl's CURLOPT_COOKIEJAR and CURLOPT_COOKIEFILE to satisfy that need. these read and write to a server-side text file which in my situation will be accessed hundreds to thousands of times a minute or more on a high-traffic site. google hasn't helped me, but i'm worried that this may not be efficient enough for an enterprise-level web application. can anyone comment on this or provide their own personal experience on the matter. one obvious options are passing the data to the client, which will pass it back for subsequent requests and then injected into the header data manually. but this is dirty, and also a bit chatty for all the subsequent ajax calls. any better ideas? i'm better versed in other server-side languages/technologies still, so there may be something out of the box i'm just unaware of. thanks. Link to comment https://forums.phpfreaks.com/topic/214862-persist-cookie-data-without-using-curlopt_cookiejar/ Share on other sites More sharing options...
n3r0x Posted September 30, 2010 Share Posted September 30, 2010 Could use some type of serverbased memory storage for their cookies, "heaptables" perhaps... Not sure how this would affect your solution when you´re have 100k+ reqs/min... Link to comment https://forums.phpfreaks.com/topic/214862-persist-cookie-data-without-using-curlopt_cookiejar/#findComment-1117750 Share on other sites More sharing options...
scanf Posted September 30, 2010 Author Share Posted September 30, 2010 Could use some type of serverbased memory storage for their cookies, "heaptables" perhaps... Not sure how this would affect your solution when you´re have 100k+ reqs/min... don't know anything about that approach, or how that would compare to just storing inside a session var. Link to comment https://forums.phpfreaks.com/topic/214862-persist-cookie-data-without-using-curlopt_cookiejar/#findComment-1117752 Share on other sites More sharing options...
n3r0x Posted September 30, 2010 Share Posted September 30, 2010 It would lower the HDD reads and writes.. Downside would be on a MySQL crash all cookies would be lost and the user would have to login again.. Would probably use a lot of memory.. Reading and Writing from memory is also faster than reading and writing from the HDD. Link to comment https://forums.phpfreaks.com/topic/214862-persist-cookie-data-without-using-curlopt_cookiejar/#findComment-1117758 Share on other sites More sharing options...
scanf Posted September 30, 2010 Author Share Posted September 30, 2010 is it possible to read/intercept what would be pushed to the cookiejar? i don't like the idea of manually parsing the headers for this if there's a more direct way. basically, i could just dump this data in a client-side cookie and then pass them back in using CURLOPT_COOKIE. Link to comment https://forums.phpfreaks.com/topic/214862-persist-cookie-data-without-using-curlopt_cookiejar/#findComment-1117765 Share on other sites More sharing options...
scanf Posted October 1, 2010 Author Share Posted October 1, 2010 bump Link to comment https://forums.phpfreaks.com/topic/214862-persist-cookie-data-without-using-curlopt_cookiejar/#findComment-1118027 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.