简体   繁体   English

php curl cookie缓存

[英]php curl cookies cache

I built a php script which register/login on a website through cURL functions. 我建立了一个PHP脚本,该脚本通过cURL函数在网站上注册/登录。 Anyway, it is working great on my local xampp server but when mpoving it on my online hosting I am getting a problem with the cookies. 无论如何,它在我的本地xampp服务器上运行良好,但是在我的在线主机上将其移动时,我遇到了Cookie问题。 After running the script first time the cookies are getting cached and the second time I try to run the script I'm getting an error from the website I try to login because of Already logged in or similar. 第一次运行脚本后,将缓存cookie,第二次尝试运行该脚本后,由于已经登录或类似原因,我从尝试登录的网站收到错误消息。 I tried to delete the text files where the cookies are stored, I tryed using different computers, IP's, browser but nothing seem to work. 我尝试删除存储cookie的文本文件,尝试使用其他计算机,IP,浏览器,但似乎无济于事。 I need to wait 3-4h until the cookies expire. 我需要等待3-4小时,直到Cookie过期。 So my question is: Can cookies somehow be cached by the server ? 所以我的问题是:服务器能否以某种方式缓存cookie? On my local server it is working just perfect. 在我的本地服务器上,它运行得非常完美。 Thank you ! 谢谢 !

Could you provide your code? 您能提供您的代码吗?

First thing I'd check is to make sure you're actually writing the cookie properly on the server and that you can read it as well. 我要检查的第一件事是确保您实际上在服务器上正确编写了cookie,并且您也可以读取它。

Also you can use curl_error() to see what errors cURL is returning. 您也可以使用curl_error()查看cURL返回的错误。 See what you find by printing that out. 打印出来即可查看发现的内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM