troubleshooting Question

Why does setcookie function not work?

Avatar of shadow_shooter
shadow_shooter asked on
PHP
19 Comments1 Solution627 ViewsLast Modified:
Hello,

I am trying to edit a PHP script and now it started to feel tired. What I'm trying to do is setting a cookie but it was not possible because of a headers already sent error. Then, I added "obstart()" at the beginning of the page to solve the problem. It worked flawless but the problem is now I cannot delete these cookies by setting them to a prior date when users log out.

It looks like PHP totally ignores the setcookie() function. The same thing happened while creating them but was solved after adding obstart() at the start. Same trick doesn't work in my logout.php

Any ideas?
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 19 Comments.
Start Free Trial
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 19 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