2024 Autor: Peter John Melton | [email protected]. Zuletzt bearbeitet: 2024-01-15 03:52
Die heutige Question & Answer-Sitzung wird von SuperUser zur Verfügung gestellt - einer Unterteilung von Stack Exchange, einer Community-basierten Gruppierung von Q & A-Websites.
Foto mit freundlicher Genehmigung von Pedro Vezini (Flickr).
Die Frage
Superuser-Leser Ruud Lenders möchte mehr darüber wissen, wie Präferenzen und Cookies für Websites funktionieren:
A pop-up displayed on a website that I visited and asked me if I would allow the website to store preferences in cookies. By accident, I chose no. Refreshing the page does not bring the pop-up back. Is there a way to get this kind of pop-up back without clearing the history and cookies?
This also got me to thinking. How can a website remember if it is allowed to store cookies? By storing it in a cookie?
Wie erinnert sich eine Website an Ihre Präferenzen insgesamt und an Ihre Entscheidungen zu Cookies im Allgemeinen?
Die Antwort
SuperUser-Mitwirkender bvukelic hat die Antwort für uns:
They asked you if you would like to store preferences in cookies, not if you would like them to set cookies in general. So if I were writing support for this feature, I would set a separate cookie (nopref) and check whether or not the user has this cookie. There is a good chance you will find such a cookie for that website, which you can clear without removing other cookies or history.
Inspecting Cookies Set for a Particular Page
In Firefox, you can list cookies for a particular web page by right-clicking a blank part of the page, then selecting the View Page Info option. You will find a View Cookies button in the Security Tab. In Chrome, you have the same View Page Info option which opens a dialog that hangs from the address bar. A link near the top will take you to a listing of cookies. I assume similar features can be found in other browsers.
Discovering if a Website Sets a Cookie
Here is one way that you can discover what the website is doing. Visit the website in Incognito Mode. Open the Developer Tools and switch to the Network Tab. Then check to see what activity is occurring in the background as you decline having the site track you with cookies. Specifically, look for response headers and see if there are any Set-Cookie headers in there. Then try deleting cookies mentioned in the header to see if that makes any difference.
About localStorage
Since another poster has mentioned localStorage (in-browser database), I will comment on this as well. I think it will be very rare that a website uses localStorage for this purpose as localStorage data is not accessible to the server unless there is JavaScript code that sends the data back to the server. If you wish to check the contents of localStorage, the fastest way is to open the Developer Tools in your browser, go to the (JavaScript) Console Tab, and type localStorage. This should give you an output that looks something like:
Storage { someKey: “value”, length: 1 }
The someKey identifies the value set by JavaScript on the web page you are on. If you believe someKey does something relevant, you can try removing it by running the following:
localstorage.removeItem(‘someKey’);
This removes the data under someKey from localStorage, and reloading the web page may restore it to factory settings. If you are not sure the particular key is set by the cookie notification functionality, you may open the web page in Incognito Mode and list the contents of localStorage before interacting with the web page.
Again, I doubt many websites use localStorage for this purpose.
Haben Sie etwas zur Erklärung hinzuzufügen? Ton aus in den Kommentaren. Möchten Sie mehr Antworten von anderen technisch versierten Stack Exchange-Benutzern lesen? Hier geht es zum vollständigen Diskussionsthread.
Empfohlen:
Die verschiedenen Arten von Glühbirnen, die Sie kaufen können, und Informationen zur Auswahl
Energieeffiziente Glühbirnen sind eine großartige Möglichkeit, Geld bei der Stromrechnung zu sparen und die Glühlampen länger zu halten. Es gibt jedoch mehrere Arten von Glühlampen und mehrere Arten, die energieeffizient sind. Hier erfahren Sie, was Sie über die verschiedenen Arten von Glühlampen wissen sollten und welche sich für Sie lohnen.
So ändern Sie, wie lange Internet Explorer eine Liste der besuchten Sites speichert
In den meisten modernen Browsern gibt es eine praktische Funktion, mit der Sie zurückblättern können, welche Seiten Sie an einem bestimmten Tag besucht haben. Was aber, wenn Sie nicht möchten, dass Ihr Browser Ihren Browserverlauf aufzeichnet? So deaktivieren Sie es
Fix: Internet Explorer 10 speichert keine Anmeldeinformationen für eine Website
Wenn Sie Internet Explorer 10 installiert haben und trotz des Speicherns Ihrer Anmeldeinformationen feststellen, dass dies der Fall ist, müssen Sie dies tun. Benutzername und Passwort, Sie werden erneut danach gefragt, dann sehen Sie dies.
ImagePicker wählt und speichert mehrere Bilder von einer Website
ImagePicker ist ein Fire-Fox-Add-On, das mehrere Bilder von einer Website auswählt und auf Ihrem lokalen Computer speichert. Es enthält mehrere Filter, um die Miniaturansicht einzuschränken.
Wie kann man eine Website in eine Windows Store-App konvertieren?
Konvertieren Sie Ihren Blog oder Ihre Website in die Windows-App und stellen Sie sie im Windows Store bereit. Folgen Sie diesem Tutorial und dieser Web-App, um dies schnell und einfach zu tun.