开发者

HTML5 and Cookies

开发者 https://www.devze.com 2023-02-02 03:06 出处:网络
With the emergence of HTML 5 and various client side storage technolog开发者_运维百科ies, do you see any useful need for cookies?Assume there isn\'t a requirement to support older browser. Login valid

With the emergence of HTML 5 and various client side storage technolog开发者_运维百科ies, do you see any useful need for cookies? Assume there isn't a requirement to support older browser.


Login validation will still use them. Don't fix what's not broken.


Diodeus is right on—if it ain't broke, why fix it? Cookies are very well supported with many browsers, including older ones, so using cookies would be a more compatible idea than using HTML5 client-side options, as many browsers do not fully support HTML5, and most of the older ones (IE8 and before) likely never will.

Although sessions are a good idea for client-side, cookies are useful for a "remember this user" capability that sessions lack, as sessions disappear after the user closes the window.


Cookies will still be around as an option just like Session is still an option for server-side. In terms of Html5 client side storage options, it's one of the more volatile parts of the specification still. Many/most browsers are support Html5 to some degree; however, how they are implementing the storage isn't consistent yet since it's changed in the spec a couple times.

To paraphrase Diodeus's answer... Cookies aren't broke so no need to fix or replace them. Html5 storage is just another option.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号