'Why do my cookies keep getting deleted in my local laravel app in chrome?

Im building a laravel project and cookies I set via JavaScript keep getting deleted, but only in Chrome and only recently, not in Safari or Firefox. What could be the cause? Working on mamp.

I notice that my laravel_session cookie value, that laravel sets, also has a different value each time I refresh the page. Is this by design?

I set the cookies via https://github.com/js-cookie/js-cookie.

(function($, Cookies){
  $(function() {

    var cookiesDefaults = {
            expires: 14
        };

    $('.consent-allow').on('click', function(event) {
        event.preventDefault();
        Cookies.set($(this).data('allows'), true, cookiesDefaults);
        location.reload();
    });
})(jQuery, Cookies);

This used to work for a long time, now it stopped. I added some auth routes, login functionality etc. but I dont see anything that could be a cause. Especially why only in Chrome.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source