troubleshooting Question

PHP fsockopen Cookie Problem

Avatar of Xplisit
Xplisit asked on
PHP
6 Comments1 Solution2824 ViewsLast Modified:
I am having a problem with my PHP script expiring cookies.

I'm using fsockopen to do a POST to a forum with the login details then using explode to grab the Cookie headers and after that using another fsockopen to do a GET to view a thread.

The problem is, the minute it logs in and takes the cookies, those cookies expire and no longer work on the second fsockopen.

I've tried manually logging in using my browser and taking the cookies and adding them to my GET fsockopen and it works well the first time but the minute you try the script again by refreshing or something, the cookie is expired and no longer works.

Is there a fix for this so PHP does not expire cookies? I'm guessing it's producing the same effect as me closing my browser which gets rid of session cookies.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 6 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros