HTTP is a stateless protocol. No request knows anything about the request before it.
We work around that with conventions like cookies, sessions, and databases.
All web browsers have decided to agree with HTTP spec(s), on things like "how to handle cookies".
We work around that with conventions like cookies, sessions, and databases.
All web browsers have decided to agree with HTTP spec(s), on things like "how to handle cookies".
Most programming languages are NOT stateless.
They are long-running processes that might share state between http requests (node, golang, ruby, python, java, etc, etc, etc)
You need to worry about mutable global objects.
They are long-running processes that might share state between http requests (node, golang, ruby, python, java, etc, etc, etc)
You need to worry about mutable global objects.
PHP, however, is weird. It was created to just be thrown in amongst your HTML, but grew into something more...
PHP is ALSO stateless! It rebuilds its entire world on each web request.
This makes is easy to reason about its code. (It's also super easy to deploy).
PHP is ALSO stateless! It rebuilds its entire world on each web request.
This makes is easy to reason about its code. (It's also super easy to deploy).
PHP is the best-in-class language for server-side web development.
