# Checkbox "remember me" (cookie): Elfinder: 401 unauthorized error

**URL:** https://forum.mautic.org/t/checkbox-remember-me-cookie-elfinder-401-unauthorized-error/27946
**Category:** Product Support
**Tags:** mautic-4
**Created:** [May 8, 2023, 7:51pm UTC](https://forum.mautic.org/t/checkbox-remember-me-cookie-elfinder-401-unauthorized-error/27946 "2023-05-08T19:51:43Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![IonutOjicaDe](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ionutojicade/32/7383_2.png) [@IonutOjicaDe](https://forum.mautic.org/u/IonutOjicaDe)
#### Post date: [May 8, 2023, 7:51pm UTC](https://forum.mautic.org/t/checkbox-remember-me-cookie-elfinder-401-unauthorized-error/27946/1 "2023-05-08T19:51:43Z")

</div>

**Your software**  
My Mautic version is: 4.4.8  
My PHP version is: 7.4.29  
My Database type and version is: 10.3.38-MariaDB-0ubuntu0.20.04.1

**Your problem**  
My problem is:  
I use the Froala Email Editor.  
With the Checkbox “remember me” activated, I receive the “401 unauthorized” error when I open elfinder.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/a/a0932e86eb591ebeed56f1d7ef0ae4b63a5e4474.png)

The error comes the day after I activated the checkbox or after the browser restart.

Without the checkbox “remember me” activated, Elfinder works as expected.

**These errors are showing in the log:**  
in Mautic there are no errors logged.  
In the Browser console, there are some message regarding the cookies and Froala editor:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/4/495d01d94f0bae460298badd2c67aa1596c2552f.png)

Also when opening the elfinder:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/1/14dc8f28105124f20d459f067a16d5deff5defc1.png)

**Steps I have tried to fix the problem:**  
Clear cookies and site data.  
Not activate the checkbox “remember me”.  
I add this line of code to keep me logged in:  
`jQuery(function () {setInterval(function(){jQuery.ajax({method: 'GET',url: 'https://m.ionutojica.com/s/credentials'});}, 9 * 1000 * 60);/*every 9 minutes*/});`  
at the end of `media/js/app.js`. But as soon as the browser restarts, I need to login again.

---

<div class="post-metadata">

### Author: ![dirk\_s](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dirk_s/32/748_2.png) [@dirk\_s](https://forum.mautic.org/u/dirk_s)
#### Post date: [May 8, 2023, 10:26pm UTC](https://forum.mautic.org/t/checkbox-remember-me-cookie-elfinder-401-unauthorized-error/27946/2 "2023-05-08T22:26:01Z")

</div>

It took me some time to try to recreate it (because I hit another unexpected bug, where the legacy builder didn’t want to load after disabling GrapeJS). When I finally was able to do so, the Elfinder worked without any issue - with or without using “staying logged in” function.

Your console comments gives you a hint: its the about the not correctly set “SameSite” attribute valkue, which may be the culprit. Please investigate into that direction…

---

<div class="post-metadata">

### Author: ![IonutOjicaDe](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ionutojicade/32/7383_2.png) [@IonutOjicaDe](https://forum.mautic.org/u/IonutOjicaDe)
#### Post date: [May 9, 2023, 3:58pm UTC](https://forum.mautic.org/t/checkbox-remember-me-cookie-elfinder-401-unauthorized-error/27946/3 "2023-05-09T15:58:28Z")

</div>

Did Elfinder worked also after a browser restart? (with the checkbox activated)  
At first, Elfinder works as expected. I usually restart the laptop each day. On the next day, Elfinder does not work anymore, and I suspect the checkbox activated to trigger the issue.

Regarding the console: I do not know what in fact can I investigate. Configuration in Mautic? Or some files in Mautic folder? Or some other settings?  
Can you give me a hint?

---

<div class="post-metadata">

### Author: ![dirk\_s](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dirk_s/32/748_2.png) [@dirk\_s](https://forum.mautic.org/u/dirk_s)
#### Post date: [May 9, 2023, 8:00pm UTC](https://forum.mautic.org/t/checkbox-remember-me-cookie-elfinder-401-unauthorized-error/27946/4 "2023-05-09T20:00:47Z")

</div>

Hi, its more into the webserver settings: Apache or Nginx, whatever you run.

> **[Set-Cookie - HTTP | MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie)**
>
> The Set-Cookie HTTP response header is used to send a cookie from the server to the user agent, so that the user agent can send it back to the server later.
> To send multiple cookies, multiple Set-Cookie headers should be sent in the same response.

You may adjust your settings to set the cookie correctly.

---

<div class="post-metadata">

### Author: ![mollux](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mollux/32/10618_2.png) [@mollux](https://forum.mautic.org/u/mollux)
#### Post date: [June 5, 2023, 12:50pm UTC](https://forum.mautic.org/t/checkbox-remember-me-cookie-elfinder-401-unauthorized-error/27946/5 "2023-06-05T12:50:53Z")

</div>

I worked on a fix on this issue, see [ensure the elfinder paths are within the default firewall, so rememberme functionality works by mollux · Pull Request #12430 · mautic/mautic · GitHub](https://github.com/mautic/mautic/pull/12430)
