I prefer to work in Google Chrome but it doesn't save my cookies of a project I'm working on right now.
When I open the (local) path in Safari the cookies will be stored correctly but Chrome doesn't save them.
How do I allow cookies of projects directly accessed from my hard-drive? Adding the exact local path to Chromes cookie settings won't work.
I thought about something like files:///[*], but it wouldn't work out for me.
Related
I am currently working with cookies on my local machine and for some reason when I try to look at the cookies it says "By default cookies are disabled for local files. You could override this by starting the browser with --enable-file-cookies command line flag". I tried going into my chrome file location, I left clicked under properties and changed the command line flag after the "target" but that didn't work. I'm not sure how I can enable local cookies at this point.
It would seem that the --enable-file-cookies flag has been removed for all platforms except android.
You can read more about it here and here.
When I inspect a page via chrome dev tools there is a very large list of cookies, as opposed to when using document.cookie there are only a few.
Can anyone explain the difference between these cookies and the ones via my console.log, and why I can not access them via javascript?
Is it even possible to get these cookies I see in the dev tool using javascript?
Do I need to set them manually first?
Thanks!
I store some info in cookies in my Javascript code. I have had no problem to set and read them from local drive until Firefox Quantum installed.
Now it seems that the cookies are set (been checked among the cookies), but cannot be read if I open the html file. The document.cookie.length value is always zero. Yet if I set the cookies and refresh the browser (or open the file again not closing the first file) the cookies can be read.
So far Firefox stored and read cookies all right using file:///, but this twist is new for me. Some setting has to be changed, I guess.
Can anybody tell me a solution, how to allow to read the cookies again from local drive?
Thank you.
Firefox Quantum (as with Google Chrome and others) has disabled storing cookies for local files due to security issues and other problems. The HTML5 web storage commands are taking over what used to be done with cookies for both server and local web pages. See "https://www.w3schools.com/html/html5_webstorage.asp"
I am currently making a web app and I have used a manifest file to get my web app to work offline. This works great and using Google Chrome, Opera etc I can view what is being cached by right clicking, inspecting the element and viewing the resources.
The problem I have is that I want to view what is stored in the cache in the app when it is being used on an i-pad. I have give this a Google but cant seem to find anything. Is there a way of displaying what is stored in the cache using some JavaScript or JQuery and then having this displayed on a web page within the app.
The app consists of a webview which is currently pulling in other html pages which are being stored in the cache using the manifest. I want to add a simple settings page where what is being stored in the cache can be viewed within the app. Hope that explains enough I would really appreciate any help with this matter.
I don't know of a way to get at this information with JavaScript either, but here are the alternatives I use.
In Mobile Safari, I connect the device to a Mac, open Safari on the Mac, open the site in Mobile Safari or open the native app going to the screen with the UIWebView, go back to the Mac and open the Develop menu. From there you can select the Storage option and view what's in the appcache.
In Chrome, you can view what's stored in the appcache using the URL chrome://appcache-internals/.
If the appcache was saved successfully, you could also simply go to the file itself in your browser.
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,
For which domain will it be saved?
How can I see it in Google Chrome? (HTML run on Chrome)
Unfortunately some browsers including Google Chrome do not store cookies from local web pages:
Why does Chrome ignore local jQuery cookies?
Firefox has great developer plugins for cookie management, which report their domains, access paths and expiry:
https://addons.mozilla.org/en-US/firefox/addon/view-cookies/
https://addons.mozilla.org/en-US/firefox/addon/firecookie/ (Personal Favourite - Requires FireBug)
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)
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.