Can you preemptively check local storage before user agrees under Cookie Law?
<p>I am pretty new to the idea of asking for consent for storage for a website because I'm American. I understand that if I want to store anything, I need to ask users for consent.</p>
<p>However, I'm confused by exactly how to abide by the Cookie Law. How do I know if the user has agreed to storage if I can't check the storage? Is it more  that I am allowed to check local storage to to see if the user has agreed previously? ie I don't store anything until the user agrees, but I may check local storage to see if the user has agreed to anything.</p>
<p>I might be digressing, but the way I interpret the law was that if I track anything that can give insight into who the user is, that's bad. But if it's used for a purely frontend application for the website (eg a personal blog that may have a search backend, but the storage items aren't used for that), I don't have to worry so much? Esp if it's storage for things like color modes or positioning of navbar (left, right, up, down)?</p>
<p>I guess what I'm getting at is what's a reasonable flow to be compliant at the same time as leveraging cookies so the site doesn't reset to vanilla and consent banner doesn't pop up <em>every</em> time the user visits?</p>

<h2>Yes, a site may check for a cookie indicating past consent before prompting for consent to read and store cookies</h2>
<p>When people speak of the &quot;Cookie law&quot; they usually mean the <a href="https://en.wikipedia.org/wiki/Privacy_and_Electronic_Communications_Directive_2002" rel="nofollow noreferrer">ePrivacy Directive</a>, (ePD) more formally the <strong>Privacy and Electronic Communications Directive 2002/58/EC</strong>. The full text of the directive is <a href="https://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=CELEX:32002L0058:en:HTML" rel="nofollow noreferrer">here</a></p>
<p>First of all, being a directive and not a regulation, the ePD is not itself legally binding. Instead it instructs the legislatures of member states to implement it, which they generally have done. So the actual binding law is the law of a particular country, which could vary from the wording of the directive. However, in this case, my understanding is that the implementations do not vary significantly.  An updated and revised ePrivacy Regulation (ePR) has been proposed, which would replace the ePD and complement the GDPR. But there has been dispute over the proposed terms of the ePR, and it has not yet been passed.</p>
<p>Article 5 section (3) of the ePD reads:</p>
<blockquote>
<ol start="3">
<li>Member States shall ensure that the use of electronic communications networks to store information or to gain access to information stored in the terminal equipment of a subscriber or user is only allowed on condition that the subscriber or user concerned is provided with clear and comprehensive information in accordance with Directive 95/46/EC, <em>inter alia</em> about the purposes of the processing, and is offered the right to refuse such processing by the data controller. This shall not prevent any technical storage or access for the sole purpose of carrying out or facilitating the transmission of a communication over an electronic communications network, or as strictly necessary in order to provide an information society service explicitly requested by the subscriber or user.</li>
</ol>
</blockquote>
<p>Notice that this covers both writing (storing) and reading (gaining access to) cookies <strong>and</strong> other information stored on a user's device. Cookies ar one form of such locally stored information (LSI).</p>
<p>Note that the GDPR, which replaces Directive 95/46/EC, is used to define &quot;consent&quot; in the ePD.</p>
<p>In general, one must have consent to read or store, and consent must be sought only when the user has been given &quot;clear and comprehensive information ... about the purpose&quot; of the stored information. The relevant exception for this question is that information (including cookies) which is &quot;strictly necessary&quot; to provide a service specifically requested by the user.</p>
<p>Here the user has requested access to the web site, and may have previously agreed to accept cookies. The site must prompt for consent if the user has not previously consented (and the site will store cookies not strictly needed), and should not if the user has. Therefore, it is strictly  necessary to check for and read if present a cookie indicating that such consent has previously been granted. If such a cookie is not found, no consent has been granted.</p>
<p>Strictly required LSI should not have a dual purpose where one purpose is not strictly needed. For example, an &quot;I accept cookies&quot; cookie should not also be used for tracking. That should be done (if at all) with a separate cookie, and only after consent is received.</p>
<p>Note that there should be an easily found and easily used method or link on the site (preferably on each page of the site) to review the purposes of stored or accessed LSI, and to withdraw previous consent. If consent is withdrawn, the cookie indicating that consent has been granted should be erased, as should any cookies or other LSI not strictly needed to provide the services requested by the user.</p>
<p>Keep in mind that the legal distinction is not between cookies that contain &quot;technical&quot; information and those that do not. That is not relevant. Nor is the distinction between cookies that might be used to identify a person and those that do not. The legal distinction is between cookies (or other LSI) that are strictly needed to provide the services requested by the user, and all other LSI. Strictly needed LSI does not require consent, all other LSI does.</p>
<p>For example, a random string, used to determine the number of unique visitors, but not linked to any identifying info about the user, does not help to identify an individual user. But it is not strictly needed, so it can only be stored with consent.</p>
<p>Data that are associated with an identifiable natural person (human being, not a firm or organization), are governed by the GDPR (where it applies). There must be a lawful basis for processing such data, which includes reading them from LSI, and storing them. Consent is one of the six possible bases for such processing, but consent need not be obtained if another lawful basis applies. When consent is the basis, it must be easily withdrawn by the user. Note that this applies to <strong>all</strong> data (PI) that is associated with a person, not just data that can readily be used to identify the person (PII).</p>
<p>Note that other workflows are also lawful. For one example, if a site is a strictly membership site, it could prompt for a login before reading or storing any LSI, and then read previous preferences stored on the server by that user to determine whether consent for cookies has been granted.</p>
<h2>Conclusion</h2>
<p>A cookie indicating that consent to access and store cookies hs previously been given by a particular user can lawfully be read before a user is prompted for consent, under the ePD and its implementing laws.</p>

internet gdpr privacy consent cookies