So, I'm developing my website and I created 2 html files to have a bilingual website. I created a modal to appear on page load and I'm using cookies to save the user click event on the button inside the modal.
The thing is, when I'm on the first language page and the modal opens up, I click the button and the cookie is saved. But when I switch to the second language page, the modal doesn't appear. When I try the opposite, the modal appears and the cookie is saved on both pages.
Not sure what I'm doing wrong or if this is how it works, first time using cookies. The code:
<div class="warning_modal">
<div id="warning_modal" class="modal">
<div class="modal_content">
<div class="warning_text">
<span>text goes here</span>
<p>
text goes here
</p>
<a href="#navigation" class="close">Ok</a>
</div>
</div>
</div>
</div>
$('.close').on(click, function(){
$(".warning_modal").css("display", "none");
Cookies.set('hide-modal', true, { expires: 7 , path: '', sameSite: 'none', secure: true});
});
$(function(){
if(Cookies.get('hide-modal'))
$(".warning_modal").css("display","none");
});