Hacker News new | comments | show | ask | jobs | submit login

I was helping a friend debug something on WPEngine. We learned that the caching doesn't allow you to set cookies it would seem (from PHP). Had to do it all using JS instead. I thought I was going crazy trying to debug the code when it was definitely an issue with the way they cache.

Not saying it was right or wrong, it just wasn't a fun experience thinking I was going crazy. And hopefully if anyone else is trying SETCOOKIE() and it's not working they also realize they will have to use JS.




That was my issue, and yes, it absolutely is one of the many reasons why staging instances should have a caching on/off switch that mirrors production. It is absolutely 100% feasible that WPEngine's caching will break your site, and you need to know this before you push to production.

Don't get me wrong, as a contractor to a company that uses WPEngine, we have had a great experience with it - but e.g. in the case of setcookie() being completely useless for unauthenticated users, some documentation / warnings / big red flags would be nice.

In my case I was trying to build a simple site selector for unauthed users that would forward them to their selected site every time they hit the main domain. Nothing exotic by a long shot.


It sounds like you and ohashi don't understand how caching works. WP caching serves up static copies of your pages, bypassing the code and DB calls that would normally be required. Since your code is bypassed cookies won't be set.

This isn't something specific to WPEngine, this is how all the good WP caching plugins work.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: