When it comes to cookies and PHP, what naming style do you use?
Here are a few styles I can think of:
- lower_case
- camelCase
- UPPER_CASE
When it comes to cookies and PHP, what naming style do you use?
Here are a few styles I can think of:
I use whatever style the coding standards for the project call for.
Generally I prefer camelCase for naming schemes, but whichever one pays the bills is the one I'll go with.
Maybe you won't like my answer:
Don't use your own cookies but store data in server sessions. So you only need one cookie (to reference the session id) and how you name that plays no role.
Keep in mind that this cookie is sent with every request, so imho, just use the smallest name you can, and document your code nicely.