Mozilla VPN is currently experiencing an outage. Our team is actively working to resolve the issue. Please check the status page for real-time updates. Thank you for your patience.

為了改善您的使用體驗,本網站正在進行維護,部分功能暫時無法使用。若本站的文件無法解決您的問題,想要向社群發問的話,請到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 發問,我們的社群成員將很快會回覆您的疑問。

搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

Does the latest version of firefox (44.0) have a problem storing cookies where the name of the cookie contains a space?

  • 4 回覆
  • 1 有這個問題
  • 1 次檢視
  • 最近回覆由 Kohei

more options

Hi,

I have javascript code that is run to create certain cookies. Since updating to Firefox 44.0, it would seem cookies don't get stored if their name contains a space.

Cookie that does not get created anymore (space inbetween 'Full' and 'text': document.cookie="text_searchfield_ROW0LIBRIOS2SEARCHFIELD[Full text]=england; path=/";

There's a space because these names have to be generated dynamically.

This is causing a bit of stress as there's a lot of websites dependent on this.

Any feedback would be appreciated.

Adam.

Hi, I have javascript code that is run to create certain cookies. Since updating to Firefox 44.0, it would seem cookies don't get stored if their name contains a space. Cookie that does not get created anymore (space inbetween 'Full' and 'text': document.cookie="text_searchfield_ROW0LIBRIOS2SEARCHFIELD[Full text]=england; path=/"; There's a space because these names have to be generated dynamically. This is causing a bit of stress as there's a lot of websites dependent on this. Any feedback would be appreciated. Adam.

被選擇的解決方法

I have posted the site compatibility doc: https://www.fxsitecompat.com/en-CA/docs/2016/whitespaces-are-no-longer-allowed-in-cookie-names/

Yeah, some apps might be broken due to this change. Mozilla developers are now aware of the issue, and Firefox may allow spaces again for backward compatibility.

從原來的回覆中察看解決方案 👍 1

所有回覆 (4)

more options

Maybe forget the bit about 'causing a bit of stress'. The code has been updated affecting my sites.

Definitely want to make you aware in case though.

more options

Perhaps this is a regression from a cookie-related security issue fixed with Firefox 44. But, I believe you have to encode the value anyway before being saved, because white spaces are not allowed. See https://developer.mozilla.org/en-US/docs/Web/API/Document/cookie

Filed a bug to make sure this change is intentional.

由 Kohei 於 修改

more options

Thanks for the response Kohei.

I agree, we should have been encoding these names - we just didn't realise we weren't encoding them until version 44 stopped them from working.

I'm sure there'll be a few others getting caught out with this.

Thank you for you time.

more options

選擇的解決方法

I have posted the site compatibility doc: https://www.fxsitecompat.com/en-CA/docs/2016/whitespaces-are-no-longer-allowed-in-cookie-names/

Yeah, some apps might be broken due to this change. Mozilla developers are now aware of the issue, and Firefox may allow spaces again for backward compatibility.