techBeginner
techBeginner

Reputation: 3850

Where are cookies saved for a local HTML file?

I created an HTML file on my desktop and added some JavaScript to set and clear cookies.

Now my question is, will the cookie be saved in my browser? Can I read it back?

if Yes,

Upvotes: 6

Views: 16529

Answers (2)

paulcol.
paulcol.

Reputation: 3000

Unfortunately some browsers including Google Chrome do not store cookies from local web pages:

Firefox has great developer plugins for cookie management, which report their domains, access paths and expiry:

For local development purposes you can setup a development domain like "localhost" or "myfakedomain.com" and run your files on a local server.

Search:

  • Editing Hosts File [operating system]
  • Setup Local server on [operating system] (I use xampp)

Upvotes: 12

isNaN1247
isNaN1247

Reputation: 18099

If you're running the 'site' on a local webserver then it should be stored in your browser under 'localhost'. If however you're just opening a static HTML file Chrome will not store the cookie.

In Chrome you can use the Chrome Developer Tools and look under the 'Resources' tab.

Upvotes: 1

Related Questions