Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I include underscore in session cookie name?

I'm curious if there is anyone using Laravel since version 3 running into problems setting cookies in various version of IE when there is an underscore in the cookie name.

I came across this problem with my project (an eCommerce site built on CI). The problem was fixed removing the underscore in cookie name.

While I'm currently porting the project to Laravel, I just want to check if I should remove the underscore from session cookie as well.

like image 801
Edwin Aw Avatar asked Feb 22 '13 03:02

Edwin Aw


2 Answers

I would definitely recommend removing any underscores from your cookie name, I've been caught out by this a few times in the past whe, and it's easy to pull your hair out trying to figure out what's going on when in the end it's the little underscore gremlin

like image 119
duellsy Avatar answered Oct 05 '22 22:10

duellsy


It's better practice to use periods instead of underscores in cookie names.

like image 25
Lee Ginger-Ninja McCarthy Avatar answered Oct 05 '22 23:10

Lee Ginger-Ninja McCarthy