5 ms·
But what do you mean "obsolete"? They are still by far the simplest solution for passing a session ID with all HTTP requests.
by goto11 7y ago
But what do you mean "obsolete"? They are still by far the simplest solution for passing a session ID with all HTTP requests.
- austincheney 7y agohttps://en.m.wikipedia.org/wiki/Obsolescence https://en.m.wikipedia.org/wiki/Obsolescence Obsolescence just means the technology in question is antiquated or fully capable of replacement by something of greater preference. As a functional term it has no bearing on frequency of use or popularity.
- goto11 7y agoSo you mean, why use a simple solution when a newer, more complex solution is available?
- austincheney 7y agoAside from their APIs they are both of equal complexity. Cookies have a far more complex API. https://developer.mozilla.org/en-US/docs/Web/API/Document/cookie https://developer.mozilla.org/en-US/docs/Web/API/Document/co... https://en.m.wikipedia.org/wiki/Complexity https://en.m.wikipedia.org/wiki/Complexity Perhaps you instead meant to use the word challenging, which is subjective depending upon who you ask.
- goto11 7y agoBut you don't even need to use the API to use cookies. You set them on the server, and the browser send them back. It works entirely without any JavaScript.
- austincheney 7y agoI already addressed that in the link in my original comment. https://news.ycombinator.com/item?id=23098196 https://news.ycombinator.com/item?id=23098196
- ComputerGuru 7y agoI’m guessing you’re a frontend guy. The two are only comparable from the frontend, if you’re developing a traditional app and want to use LS instead of cookies, it is certainly embarrassingly more complex as you’re forced into a JS intermediary to channel info between LS and your backend. So, no, certainly not equal complexity.
- austincheney 7y agoI am a fullstack developer. It is the same level of complexity because there is an intermediary either way. Web servers do provide authentication capabilities, but commercial web servers have not relied upon that since the late 90s / early 00s. Most web servers use something equivalent to Spring MVC to maintain both authentication and session management largely because the authentication capability supplied by the web server are only there to protect access to the server and thus directly doesn't account for most common security considerations, example OWASP Top 10. Authentication and session management across a network can be accomplished across a variety of ways. Operating systems prefer Kerberos for remote authentication. Cookies are preferred by developers who fear JavaScript precisely because because they can be written and transmitted without need for JavaScript. The same end result, authentication and session management, can be accomplished with the same complexity without cookies. Complexity refers to the number of steps involved and not the challenge imposed upon the developer. https://en.wikipedia.org/wiki/Complexity https://en.wikipedia.org/wiki/Complexity The only reason to prefer an out-dated functionally obsolete technology is fear of disruption. I have explained all this already, please see the comment I linked to from above: https://news.ycombinator.com/item?id=23098196 https://news.ycombinator.com/item?id=23098196
- goto11 7y ago> Cookies are preferred by developers who fear JavaScript precisely because because they can be written and transmitted without need for JavaScript. You seem to believe that developers should always chose the most complex and intricate solution possible, and the only reason someone would chose a simpler solution would be due to incompetence or ignorance of the more complex solution. This is completely opposite of all good engineering practice. Complexity is not a goal, it is a liability. You want to have the minimum amount of complexity which solves the problem.
- shawnz 7y agoBut you said yourself, cookies are preferred by developers. So localstorage is not of greater preference.
- austincheney 7y agoI never made such a claim, though I suspect localStorage would be preferred by end users since there is a distinctive performance difference.
- shawnz 7y agoYes you did: > The primary reason cookies are still preferred is due to developer ignorance. And furthermore: > localStorage would be preferred by end users since there is a distinctive performance difference I would think cookies would be more performant in the most common case of exchanging a session ID with the server. How would you even achieve that with localStorage besides grabbing all dynamic data with XHR requests after the page loads?
- austincheney 7y ago> I would think cookies would be more performant If you don't know don't guess. This is measurable. The primary reason cookies are so incredibly slow ot process is that they require parsing.
- shawnz 7y agoThen show me some benchmarks, I wasn't the one that made the claim
- austincheney 7y agoI don’t do research for people. If you lack the curiosity to seek out the answer then just disagree with me.
- 7y ago