# Session expired - please login

**URL:** https://forum.mautic.org/t/session-expired-please-login/18399
**Category:** Product Support
**Created:** [March 2, 2021, 5:25pm UTC](https://forum.mautic.org/t/session-expired-please-login/18399 "2021-03-02T17:25:11Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Sir.Naomi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/sir.naomi/32/2888_2.png) [@Sir.Naomi](https://forum.mautic.org/u/Sir.Naomi)
#### Post date: [March 2, 2021, 5:25pm UTC](https://forum.mautic.org/t/session-expired-please-login/18399/1 "2021-03-02T17:25:11Z")

</div>

**Your software**  
My Mautic version is: 3.1.2  
My PHP version is: 7.2  
My Database type and version is: MariaDB 10.3.27

**Your problem**  
My problem is:

Hi,  
During my mautic session work, I need to leave for some other tasks, but often I leave mautic in the middle of a task, for example I’m setting up a campaign inside the campaign builder, then I leave mautic and do some stuff, then I return to my campaign and whenever I click something it says: " Session expired - please login".

It’s sometimes very frustrating and not very productive, since I choose every time the option " keep me logged in" on but it seems to not having an impact.

Is there any solution to this please ?

---

<div class="post-metadata">

### Author: ![appsinvent](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/appsinvent/32/13786_2.png) [@appsinvent](https://forum.mautic.org/u/appsinvent)
#### Post date: [March 3, 2021, 5:45am UTC](https://forum.mautic.org/t/session-expired-please-login/18399/2 "2021-03-03T05:45:36Z")

</div>

Which browser and is in incognito mode ?

---

<div class="post-metadata">

### Author: ![Sir.Naomi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/sir.naomi/32/2888_2.png) [@Sir.Naomi](https://forum.mautic.org/u/Sir.Naomi)
#### Post date: [March 3, 2021, 11:06am UTC](https://forum.mautic.org/t/session-expired-please-login/18399/3 "2021-03-03T11:06:40Z")

</div>

I’m using Chrome Version 88.0.4324.190 (Official Build) (64-bit) with normal window mode

---

<div class="post-metadata">

### Author: ![Sir.Naomi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/sir.naomi/32/2888_2.png) [@Sir.Naomi](https://forum.mautic.org/u/Sir.Naomi)
#### Post date: [March 3, 2021, 8:46pm UTC](https://forum.mautic.org/t/session-expired-please-login/18399/4 "2021-03-03T20:46:42Z")

</div>

I can’t tell if the probleme is related to version 3 or to cpanel softaculous installation procedure.

Cause today, and for testing purposes, I installed version 2.15.3 using .zip file, and after some time of mautic dashboard (v2.15.3) being out of focus it stays perfectly connected and didnt trigger the “session expired” message.

---

<div class="post-metadata">

### Author: ![robm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/robm/32/260_2.png) [@robm](https://forum.mautic.org/u/robm)
#### Post date: [June 2, 2021, 8:59am UTC](https://forum.mautic.org/t/session-expired-please-login/18399/5 "2021-06-02T08:59:31Z")

</div>

This question came up in yesterday’s mautic help desk hang out with @joeyk @DavidSchargel

I was able to increase my session duration by edit the php.ini file.

My mautic is in a sub domain on a shared host so I did not have a php.ini file. I asked my host to make one for me but I believe I could have easily done it myself and placed it in the root directory of the subdomain.

Then I added  
session.gc\_maxlifetime = 2000  
to the that file

So far so good, I have not been logged out. U could increase the session duration by increasing the number of seconds.

Simply put, the session duration is governed by your PHP settings and not by Mautic.

---

<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 1, 2023, 8:04am UTC](https://forum.mautic.org/t/session-expired-please-login/18399/6 "2023-05-01T08:04:41Z")

</div>

**Later edit**  
it seems that the “remember me” checkbox works properly since 4.4.1: [https://github.com/mautic/mautic/pull/11363](https://github.com/mautic/mautic/pull/11363)

**Later later edit**  
the cookie does not work properly with Froala Editor. The File browser to insert an image (elfinder) comes with an error (401 unauthorized). See more here: [Checkbox "remember me" (cookie): Elfinder: 401 unauthorized error](https://forum.mautic.org/t/checkbox-remember-me-cookie-elfinder-401-unauthorized-error/27946)

**Old post content**  
I hoped the issue is solved in the new version of Mautic (4.4.8) - but no, the bug is still present. Does anyone know an “out of the box” solution, that comes with Mautic, without being necessary to add some JS-code in the app.js or change the php.ini or …?

This subject was discussed also here:

> [@Mautic logs me out every X minutes. I want to be logged in for 1 month at least!](https://forum.mautic.org/t/mautic-logs-me-out-every-x-minutes-i-want-to-be-logged-in-for-1-month-at-least/26081):
>
> When using mautic, I login into the dashboard and I then I do other things. I come back and it has logged out. I want it to be like google or facebook: Keep me logged in “forever” until I close the session. How can I achieve this?

The solution I use:  
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.
