[Skip to main content](#vessel-content)

#   Firefox and SameSite cookie attribute

##

- **[dhusband](/forum/user/60503-dhusband "View dhusband's Profile")**
- [![dhusband's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/60503-dhusband "View dhusband's Profile") Topic Author
- [ Offline](/forum/user/60503-dhusband)

Less More

- Posts: 52
- Thank you received: 6
-
-

4 years 2 months ago [\#344074](#344074) by [dhusband](/forum/user/60503-dhusband "View dhusband's Profile")  *[Firefox and SameSite cookie attribute](/forum/25-install-update/904885-firefox-and-samesite-cookie-attribute#344074 "-- HikaShop version -- : 4.6.1 -- Joomla version -- : 3.10.10 -- PHP version -- : 7.4.30 -- Browser(s) name and version -- : Firefox -- Error-message(debug-mod must be tuned on) -- : Cookie “hikashop&#95;cart&#95;id” does not have a proper “SameSite” attribute value. Soon, cookies without the “SameSite” attribute or with an invalid value will be treated as “Lax”. This means that the cookie will no longer be sent in third-party contexts. If your application depends on this cookie being available in such contexts, please add the “SameSite=None“ attribute to it. To know more about the “SameSite“ attribute, read   developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite  level-2-manual-handling-principle-and-practice  Cookie “hikashop&#95;cart&#95;session&#95;id” does not have a proper “SameSite” attribute value. Soon, cookies without the “SameSite” attribute or with an invalid value will be treated as “Lax”. This means that the cookie will no longer be sent in third-party contexts. If your application depends on this cookie being available in such contexts, please add the “SameSite=None“ attribute to it. To know more about the “SameSite“ attribute, read   developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite  level-2-manual-handling-principle-and-practice  Firefox has changed security on cookies, which now causes errors if SameSite is not set correctly. Firefox is currently giving various warnings depending on the actions undertaken. Is there any plan to update the values in cookies to stop this or am I missing something in Joomla? I am not currently seeing the issue on other browsers.")* was created by *[dhusband](/forum/user/60503-dhusband "View dhusband's Profile")*

-- HikaShop version -- : 4.6.1
-- Joomla version -- : 3.10.10
-- PHP version -- : 7.4.30
-- Browser(s) name and version -- : Firefox
-- Error-message(debug-mod must be tuned on) -- : Cookie “hikashop_cart_id” does not have a proper “SameSite” attribute value. Soon, cookies without the “SameSite” attribute or with an invalid value will be treated as “Lax”. This means that the cookie will no longer be sent in third-party contexts. If your application depends on this cookie being available in such contexts, please add the “SameSite=None“ attribute to it. To know more about the “SameSite“ attribute, read [ developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite](https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite) level-2-manual-handling-principle-and-practice

Cookie “hikashop_cart_session_id” does not have a proper “SameSite” attribute value. Soon, cookies without the “SameSite” attribute or with an invalid value will be treated as “Lax”. This means that the cookie will no longer be sent in third-party contexts. If your application depends on this cookie being available in such contexts, please add the “SameSite=None“ attribute to it. To know more about the “SameSite“ attribute, read [ developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite](https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite) level-2-manual-handling-principle-and-practice

Firefox has changed security on cookies, which now causes errors if SameSite is not set correctly. Firefox is currently giving various warnings depending on the actions undertaken. Is there any plan to update the values in cookies to stop this or am I missing something in Joomla?
I am not currently seeing the issue on other browsers.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzkwNDg4NS1maXJlZm94LWFuZC1zYW1lc2l0ZS1jb29raWUtYXR0cmlidXRlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86358
- Thank you received: 14290
-
-

4 years 2 months ago [\#344076](#344076) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Firefox and SameSite cookie attribute](/forum/25-install-update/904885-firefox-and-samesite-cookie-attribute#344076 "-- HikaShop version -- : 4.6.1 -- Joomla version -- : 3.10.10 -- PHP version -- : 7.4.30 -- Browser(s) name and version -- : Firefox -- Error-message(debug-mod must be tuned on) -- : Cookie “hikashop&#95;cart&#95;id” does not have a proper “SameSite” attribute value. Soon, cookies without the “SameSite” attribute or with an invalid value will be treated as “Lax”. This means that the cookie will no longer be sent in third-party contexts. If your application depends on this cookie being available in such contexts, please add the “SameSite=None“ attribute to it. To know more about the “SameSite“ attribute, read   developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite  level-2-manual-handling-principle-and-practice  Cookie “hikashop&#95;cart&#95;session&#95;id” does not have a proper “SameSite” attribute value. Soon, cookies without the “SameSite” attribute or with an invalid value will be treated as “Lax”. This means that the cookie will no longer be sent in third-party contexts. If your application depends on this cookie being available in such contexts, please add the “SameSite=None“ attribute to it. To know more about the “SameSite“ attribute, read   developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite  level-2-manual-handling-principle-and-practice  Firefox has changed security on cookies, which now causes errors if SameSite is not set correctly. Firefox is currently giving various warnings depending on the actions undertaken. Is there any plan to update the values in cookies to stop this or am I missing something in Joomla? I am not currently seeing the issue on other browsers.")*

Hi,

That's not really an error. It just a warning and that warning can be ignored. The cookies work as expected like that.
The cookies are only to provide the cart_id and session_id for the browser to the server, so there is no need for third party context support.

Now, we could potentially add that but with the setcookie function we're using there, it's only possible to set the SameSite attribute with PHP 7.3 or higher. And since we still support older versions of PHP, we can't really use the normal way of setting it.

There is a roundabout way though. Try changing the code: Code:

if((int)@$this-&gt;user-&gt;user_id &gt; 0) { @setcookie('hikashop_'.$type.'_id', '', time() - 3600, '/'); @setcookie('hikashop_'.$type.'_session_id', '', time() - 3600, '/'); } else { $delay = (int)$this-&gt;config-&gt;get('cart_cookie_retaining_period', 31557600); @setcookie('hikashop_'.$type.'_id', $element, time() + $delay, "/"); @setcookie('hikashop_'.$type.'_session_id', $jsession-&gt;getId(), time() + $delay, "/"); }

to: Code:

if((int)@$this-&gt;user-&gt;user_id &gt; 0) { @setcookie('hikashop_'.$type.'_id', '', time() - 3600, '/; SameSite=Lax'); @setcookie('hikashop_'.$type.'_session_id', '', time() - 3600, '/; SameSite=Lax'); } else { $delay = (int)$this-&gt;config-&gt;get('cart_cookie_retaining_period', 31557600); @setcookie('hikashop_'.$type.'_id', $element, time() + $delay, "/; SameSite=Lax"); @setcookie('hikashop_'.$type.'_session_id', $jsession-&gt;getId(), time() + $delay, "/; SameSite=Lax"); }

in the file administrator/components/com_hikashop/classes/cart.php
That should remove these warnings even on older versions of PHP.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzkwNDg4NS1maXJlZm94LWFuZC1zYW1lc2l0ZS1jb29raWUtYXR0cmlidXRlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.053 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
