Should I include underscore in session cookie name?

最后都变了- 提交于 2019-12-23 11:00:34

问题


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.


回答1:


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




回答2:


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




回答3:


Basically you dont need the underscore - so just remove it. Why have a risk at all, when you can have zero risk by removing it :)



来源:https://stackoverflow.com/questions/15016204/should-i-include-underscore-in-session-cookie-name

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!