Google Chrome and localhost cookies

Why Google Chrome sucks at handling localhost cookies.

Looking for a new simple way to plan your day? Get organized with Five.Today

There are many (many) things that annoy me about Google Chrome, but this is the dumbest.

Considering how easy it is to work around, I've no idea what the point of this feature is. Surely not security? Certainly wasting a lot of developer's time.

My own personal work around is to set the domain on the session cookie to be null, so rather than:

session_set_cookie_params(0, '/', 'localhost', false, true); // where 'localhost' is injected from somewhere...

Use:

session_set_cookie_params(0, '/', null, false, true);

Sigh :-(

Looking for a modern PHP framework to build your new project? Please consider using the Alpha Framework

John Collins

I have been writing about web technology and software development since 2001. I am the developer of the Alpha Framework for PHP, and the Five.Today personal productivity app. I love open source, technology, and economics.