Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cookie “PHPSESSID” will be soon treated as cross-site cookie against <file> because the scheme does not match

I've just noticed my console is littered with this warning, appearing for every single linked resource. This includes all referenced CSS files, javascript files, SVG images, and even URLs from ajax calls (which respond in JSON). But not images.

The warning, for example in case of a style.css file, will say:

Cookie “PHPSESSID” will be soon treated as cross-site cookie against “http://localhost/style.css” because the scheme does not match.

But, the scheme doesn't match what? The document? Because that it does.

  • The URL of my site is http://localhost/.
  • The site and its resources are all on http (no https on localhost)
  • The domain name is definitely not different because everything is referenced relative to the domain name (meaning the filepaths start with a slash href="/style.css")

The Network inspector just reports a green 200 OK response, showing everything as normal.

It's only Mozilla Firefox that is complaining about this. Chromium seems to not be concerned by anything. I don't have any browser add-ons. The warnings seem to originate from the browser, and each warning links to view the corresponding file source in Debugger.

Why is this appearing?

like image 233
Digital Ninja Avatar asked Aug 07 '20 08:08

Digital Ninja


People also ask

What is the purpose of Phpsessid cookie?

It's the identifier for your current session in PHP. If you delete it, you won't be able to access/make use of session variables.

What is Pma_lang?

pma_lang_https cookie is phpMyAdmin database manager language. phpMyAdmin creates this cookie to store language configuration.

What does SameSite none mean?

A New Model for Cookie Security and Transparency Developers must use a new cookie setting, SameSite=None , to designate cookies for cross-site access. When the SameSite=None attribute is present, an additional Secure attribute must be used so cross-site cookies can only be accessed over HTTPS connections.


2 Answers

that was exactly same happening with me. the issue was that, firefox keeps me showing even Cookies of different websites hosted on same URL : "localhost:Port number" stored inside browser memory.

In my case, i have two projects configured to run at http://localhost:62601, when i run first project, it saves that cookie in browser memory. when i run second project having same URL, Cookie is available inside that projects console also.

what you can do, is delete the all of the cookies from browser.

like image 50
Paramjot Singh Avatar answered Oct 20 '22 19:10

Paramjot Singh


@Paramjot Singh's answer is correct and got me most of the way to where I needed to be. I also wasted a lot of time staring at those warnings.

But to clarify a little, you don't have to delete ALL of your cookies to resolve this. In Firefox, you can delete individual site cookies, which will keep your settings on other sites.

To do so, click the hamburger menu in the top right, then, Options->Privacy & Security or Settings->Privacy & Security

From here, scroll down about half-way and find Cookies and Site Data. Don't click Clear Data. Instead, click Manage Data. Then, search for the site you are having the notices on, highlight it, and Remove Selected

Simple, I know, but I made the mistake of clearing everything the first time - maybe this will prevent someone from doing same.

like image 27
Watercayman Avatar answered Oct 20 '22 20:10

Watercayman