TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Things not available when someone blocks all cookies

538 pointsby 0xedbover 2 years ago

32 comments

ckemereover 2 years ago
I naively assumed from the headline that the author would complain about users blocking cookies. I was very pleasantly surprised to see a post written by someone who appreciates that some users will want to do this and is actively working to support delivering them a useful content experience!
评论 #32662094 未加载
评论 #32673996 未加载
mcvover 2 years ago
I often think that instead of completely blocking cookies, it would be better to accept them and then throw them away. Same with localStorage. Just store it temporarily.
评论 #32662428 未加载
评论 #32662425 未加载
评论 #32662665 未加载
评论 #32662337 未加载
评论 #32662301 未加载
评论 #32663278 未加载
评论 #32666680 未加载
评论 #32663530 未加载
评论 #32671359 未加载
评论 #32665089 未加载
评论 #32664869 未加载
评论 #32662578 未加载
评论 #32662522 未加载
评论 #32668408 未加载
josephcsibleover 2 years ago
What if browsers made it so when you turned off cookies, instead of not allowing anything to be written, they instead gave each page you visited its own fresh cookie jar that was cleared when you navigated away?
评论 #32661260 未加载
评论 #32661294 未加载
评论 #32661254 未加载
评论 #32661244 未加载
评论 #32661321 未加载
评论 #32661258 未加载
评论 #32662170 未加载
评论 #32661875 未加载
评论 #32661250 未加载
评论 #32661467 未加载
评论 #32661281 未加载
评论 #32661984 未加载
jefftkover 2 years ago
<i>&gt; All I am using is some innocent localStorage and IndexedDB to persist user settings like the values of the sliders or the chosen color scheme.</i><p>When you turn off cookies you&#x27;re telling the browser not to let sites persist information. Otherwise, whatever goals you had in disabling cookies would just be worked around through these other technologies.
评论 #32662028 未加载
评论 #32664027 未加载
评论 #32665798 未加载
评论 #32666199 未加载
评论 #32661764 未加载
评论 #32663100 未加载
评论 #32664712 未加载
评论 #32669473 未加载
ricardobeatover 2 years ago
I always use a wrapper around local&#x2F;session storage[1] to avoid this problem. Then you have your app <i>sync</i> settings with storage, never read from it except during startup.<p>It becomes impossible to implement basic UI features like remembering open panes, etc when storage is disabled though. With the current policies around cookies - no cross-domain reads, Safari&#x27;s ITP - there is no real need to turn them off for privacy reasons, for the average user at least.<p>[1] <a href="https:&#x2F;&#x2F;www.npmjs.com&#x2F;package&#x2F;localstory" rel="nofollow">https:&#x2F;&#x2F;www.npmjs.com&#x2F;package&#x2F;localstory</a>
评论 #32662942 未加载
1vuio0pswjnm7over 2 years ago
&quot;(On a tangent, MDN is completely broken with cookies blocked, too. I was about to report this problem (because I care and love MDN), when I discovered a PR is already under way that fixes the Issue. Thanks, @bershanskiy!)&quot;<p>This would imply that &quot;MDN&quot; is under a state of rapid flux, potentially &quot;breaking&quot; and then being &quot;fixed&quot; (or not) over short periods of time. However it appears from the edit history that most of it is actually static and has not changed since 2019 or 2020.^1<p>Perhaps the &quot;completely broken&quot; catchphrase invoked by the author refers to an issue with &quot;cosmetics&quot; (window dressing) not content. I use a text-only browser and have not found MDN to be either partially or completely &quot;broken&quot;. I send an HTTP request for a file and I receive the contents of the file. For me, it works. No cookies or Javascript required.<p>1. <a href="https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;mdn&#x2F;content&#x2F;main&#x2F;files&#x2F;en-us&#x2F;_wikihistory.json" rel="nofollow">https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;mdn&#x2F;content&#x2F;main&#x2F;files&#x2F;en-...</a><p>If I want to check browser compatibility, which can change from time to time, I can use Github or the MDN website.<p>For example,<p><a href="https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;mdn&#x2F;browser-compat-data&#x2F;main&#x2F;http&#x2F;headers&#x2F;Clear-Site-Data.json" rel="nofollow">https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;mdn&#x2F;browser-compat-data&#x2F;ma...</a><p><a href="https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;HTTP&#x2F;Headers&#x2F;Clear-Site-Data&#x2F;bcd.json" rel="nofollow">https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;HTTP&#x2F;Headers&#x2F;Cl...</a>
pacifikaover 2 years ago
I created an extension that limits the maximum lifetime of cookies, I was surprised to see some have a lifetime of years. <a href="https:&#x2F;&#x2F;addons.mozilla.org&#x2F;en-GB&#x2F;firefox&#x2F;addon&#x2F;fresh-cookies&#x2F;" rel="nofollow">https:&#x2F;&#x2F;addons.mozilla.org&#x2F;en-GB&#x2F;firefox&#x2F;addon&#x2F;fresh-cookies...</a>
londons_exploreover 2 years ago
Why does the browser pretend to have localstorage but then throw an exception when it&#x27;s used?<p>Surely it would be better to simply pretend to not support localstorage and then all sites built with feature detection would work correctly without needing to special case this?
评论 #32674392 未加载
smallerfishover 2 years ago
The Atlantic is really annoying in this respect. When you open an article in Firefox Focus, it fully renders for a moment, but then apparently some javascript loads at the end of the cycle which clears the page.
评论 #32661521 未加载
paulhodgeover 2 years ago
Yeah, adding try&#x2F;catch around those has been a good practice for a while. I think there was a time when, if the site was running in a private window in Safari, localStorage would also throw exceptions.
stirayover 2 years ago
I handle cookies on my proxy where I change them to per session cookies and interestingly the sites that have cookies that are &quot;necessary for sites to work&quot;, are working flawlessly (&#x2F;s)
ur-whaleover 2 years ago
&gt; All I am using is some innocent localStorage and IndexedDB to persist user settings<p>Hrm, isn&#x27;t this the exact definition of a cookie?
评论 #32664366 未加载
johndhiover 2 years ago
God bless this man for making this -- but you know what&#x27;s CRAZY to me? That no one has done this before.<p>We all visit websites constantly and governments (particularly in EU) talk endlessly and vaguely about cookies and yet almost NO ONE really gets it. I work on this specific problem and it is SUCH a mess.
WaitWaitWhaover 2 years ago
An interesting facet of this is the implicit trust by the author towards the downstream tooling and libraries. He is not alone.<p>We talk about how we need to make sure dependencies are secure, but I venture to state, it is often just brushed over. Yes, <i>supply chain security</i> (now to rinse my mouth out).
sebazzzover 2 years ago
Weird to throw an exception when localStorage is not available. It is much more logical to have it undefined or null. Code working with localStorage is more likely to check whether it is available (“not falsey”) rather than trying to use it and fall back if it throws.
评论 #32663017 未加载
asddubsover 2 years ago
One thing that annoys me about firefox&#x27;s total cookie protection is that I offer some 3rd party embeds. What I did on those is I set a cookie, and probed for its existance to check if the user has third party cookies disabled. Then if they do, it displays things for the case where it&#x27;s not known whether or not the user is logged in to the service, rather than as if they&#x27;re definitely not logged in.<p>This worked fine, but now that firefox just containerizes third party resources rather than actually blocking the cookies, so there&#x27;s no longer a way to detect that the actual site cookies just aren&#x27;t being delivered in a third party context, rather than not present without user agent sniffing.
yoyopaover 2 years ago
instead of blocking cookies, it would be nice if there was something like &quot;Certified Humane&quot; for websites... and you could stick within an internet of websites created by people who are not dicks.
nerdponxover 2 years ago
I think the problem here is &quot;potentially blocked&quot;.<p>How do you know what&#x27;s potentially blocked? Maybe it&#x27;s listed clearly somewhere in the browser docs, or maybe it&#x27;s not. Did they change it between versions? Did you even know about this issue in the first place?<p>I know people like to think of checked exceptions as a failed experiment from the dark past of object oriented programming, but this situation is a great example of statically-typed (or at least statically-checkable) side effects are a huge improvement in code safety.
tomxorover 2 years ago
This feels kinda unscalable though...<p>wouldn&#x27;t it make more sense to change the browser to make cookies and localstorage non-persistent and isolated, but otherwise available programmatically and to XHRs.<p>i.e so that they can exist in isolation as long as the tab is open. This would be compatible with anything that doesn&#x27;t require cross frame or cross tab persistence (which is usually all users care about).
评论 #32662060 未加载
Scoundrellerover 2 years ago
Looking forward to the day some webmaster sets the background to pictures of cookies when you block them all.
gameshot911over 2 years ago
Why is the website failing with unhandled errors, but working when they are try&#x2F;catch&#x27;d? Either way the errors are being thrown, and the functionality isn&#x27;t available. Is the browser not able to handle the situation itself more gracefully?
评论 #32662682 未加载
dawalbertoover 2 years ago
Someone knows if this happens only in Chrome or also in the rest of popular browsers?
edemover 2 years ago
Fun fact: the code example with the glow effect was created with [Carbon](<a href="https:&#x2F;&#x2F;carbon.now.sh&#x2F;" rel="nofollow">https:&#x2F;&#x2F;carbon.now.sh&#x2F;</a>)
traszover 2 years ago
I wonder if instead of blocking cookies we could make a browser extension to share the tracking cookies (and only those) with random people on the web, to confuse trackers?
mohasover 2 years ago
Not directly related to this article but doesn&#x27;t aggressively blocking tracking in this way create a tracking monopoly for browsers, extensions and apps?
grishkaover 2 years ago
Why throw an exception instead of providing real working versions of these things that only persist data for as long as the page is open?
throwaway58670over 2 years ago
I recently read a thread about privacy here. One point was that the one best thing you can do is disable JavaScript. So I decided to try it. I installed Brave on my phone and disabled pretty much everything, including all cookies.<p>My thinking was, all I do is browse HN, hn.algolia, and lobsters. Those should work, right? Well lobsters works perfectly, including collapsing comments.<p>HN loses the ability to collapse comments. But algolia is the worst. Not only does it require JS, being an SPA, but it refuses to work until you enable cookies! My theory is that it reads the settings (popular, 24-hour) from a cookie, and plain dies if they&#x27;re not there.<p>On another note, and to a pleasant surprise, a lot of the web works perfectly fine, and feels a lot snappier, including even google search. And many of the annoying cookie and paywall popups never appear, since they appear to be implemented in JS.<p>So yes, if you haven&#x27;t tried it, I recommend you do. You can always whitelist sites you trust or really need to use.
johncoltraneover 2 years ago
I always accept all cookies because they have never had any negative impact on my surfing experience ever. Cookie banners and Privacy banners are much more of a problem than cookies ever were.
soperjover 2 years ago
Is there a way to use csrf tokens without cookies?
self_awarenessover 2 years ago
How about, you know, handling error conditions?
user3939382over 2 years ago
I just want to take this opportunity to thank &quot;adtech&quot; and everyone working in it for making local storage way more complex than it otherwise needed to be because you couldn&#x27;t&#x2F;can&#x27;t stop yourselves from abusing users.
评论 #32663164 未加载
评论 #32663876 未加载
评论 #32662907 未加载
评论 #32663334 未加载
rthomas6over 2 years ago
Just don&#x27;t use Chrome if it&#x27;s user hostile. Use something else that&#x27;s not.
评论 #32663372 未加载