# Web session not expiring

**URL:** <https://help.nextcloud.com/t/web-session-not-expiring/60286>\
**Category:** ℹ️ Support\
**Tags:** nc16\
**Created:** [September 19, 2019, 2:24pm UTC](https://help.nextcloud.com/t/web-session-not-expiring/60286 "2019-09-19T14:24:50Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dridhas](https://help.nextcloud.com/letter_avatar/dridhas/32/5_5575768a8748004e209b776fc1b2916d.png) [@Dridhas](https://help.nextcloud.com/u/Dridhas)\
**Post date:** [September 19, 2019, 2:24pm UTC](https://help.nextcloud.com/t/web-session-not-expiring/60286/1 "2019-09-19T14:24:50Z")

</div>

Hello all,

Good day and hoping this finds you well.

just want to know if its normal for the web session to not expire?

this is the configuration ive got on my config.php:  
‘session\_lifetime’ =\> 60 \* 60 \* 1,  
‘session\_keepalive’ =\> false,  
‘remember\_login\_cookie\_lifetime’ =\> 60 \* 60 \* 24 \* 7,

now, im using rainloop via web browser, but if i leave the tab open for more than 12 hours it will still be active.

ideally i would like to have it to log you off automatically after 8 hours of inactivity.

Can you please advise?

thanks in advance!

---

<div class="post-metadata">

**Author:** ![Dridhas](https://help.nextcloud.com/letter_avatar/dridhas/32/5_5575768a8748004e209b776fc1b2916d.png) [@Dridhas](https://help.nextcloud.com/u/Dridhas)\
**Post date:** [September 30, 2019, 3:56pm UTC](https://help.nextcloud.com/t/web-session-not-expiring/60286/2 "2019-09-30T15:56:48Z")

</div>

Anyone else having this issue?

---

<div class="post-metadata">

**Author:** ![Dridhas](https://help.nextcloud.com/letter_avatar/dridhas/32/5_5575768a8748004e209b776fc1b2916d.png) [@Dridhas](https://help.nextcloud.com/u/Dridhas)\
**Post date:** [November 12, 2019, 5:42pm UTC](https://help.nextcloud.com/t/web-session-not-expiring/60286/3 "2019-11-12T17:42:48Z")

</div>

is this normal?

---

<div class="post-metadata">

**Author:** ![anon9582441](https://help.nextcloud.com/letter_avatar/anon9582441/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon9582441](https://help.nextcloud.com/u/anon9582441)\
**Post date:** [November 12, 2019, 7:18pm UTC](https://help.nextcloud.com/t/web-session-not-expiring/60286/4 "2019-11-12T19:18:28Z")

</div>

The session remains active if the browser has the page loaded.

---

<div class="post-metadata">

**Author:** ![Dridhas](https://help.nextcloud.com/letter_avatar/dridhas/32/5_5575768a8748004e209b776fc1b2916d.png) [@Dridhas](https://help.nextcloud.com/u/Dridhas)\
**Post date:** [November 12, 2019, 8:18pm UTC](https://help.nextcloud.com/t/web-session-not-expiring/60286/5 "2019-11-12T20:18:43Z")

</div>

so, correct me if im wrong… if i leave the tab with my nextcloud open it will never expire?

even after inactivity?

Regards!

---

<div class="post-metadata">

**Author:** ![anon9582441](https://help.nextcloud.com/letter_avatar/anon9582441/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon9582441](https://help.nextcloud.com/u/anon9582441)\
**Post date:** [November 13, 2019, 11:58am UTC](https://help.nextcloud.com/t/web-session-not-expiring/60286/6 "2019-11-13T11:58:58Z")

</div>

Yes probably since there is JavaScript running checking for notifications etc.

---

<div class="post-metadata">

**Author:** ![Dridhas](https://help.nextcloud.com/letter_avatar/dridhas/32/5_5575768a8748004e209b776fc1b2916d.png) [@Dridhas](https://help.nextcloud.com/u/Dridhas)\
**Post date:** [November 13, 2019, 4:46pm UTC](https://help.nextcloud.com/t/web-session-not-expiring/60286/7 "2019-11-13T16:46:10Z")

</div>

so, what would be the need for session expiration if it actually does not expire?

---

<div class="post-metadata">

**Author:** ![anon9582441](https://help.nextcloud.com/letter_avatar/anon9582441/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon9582441](https://help.nextcloud.com/u/anon9582441)\
**Post date:** [November 13, 2019, 6:34pm UTC](https://help.nextcloud.com/t/web-session-not-expiring/60286/8 "2019-11-13T18:34:39Z")

</div>

If you close the browser then the session will expire so that the server doesn’t keep sessions forever.

You’re looking for auto lock or auto logout. Not sure that exists.

---

<div class="post-metadata">

**Author:** ![Frankie\_Heck](https://help.nextcloud.com/user_avatar/help.nextcloud.com/frankie_heck/32/31450_2.png) [@Frankie\_Heck](https://help.nextcloud.com/u/Frankie_Heck)\
**Post date:** [November 21, 2020, 6:57am UTC](https://help.nextcloud.com/t/web-session-not-expiring/60286/9 "2020-11-21T06:57:21Z")

</div>

I had the same issue and I still wonder, that this security behavior still exists in nextcloud 20.0.1! It is a security leak for me, when a session never ends! To disable long running session you might to set those 3 parameters in your _/config/config.php_ like this:

```
'session_lifetime' => 3600,
'session_keepalive' => false,
'remember_login_cookie_lifetime' => 0,

```

The main problem seems to be the cookie lifetime (parameter _remember\_login\_cookie\_lifetime_). I changed it to zero. This ensures, that I need to login myself again, whenever I close the browser. You can change it’s value to same as _session\_lifetime_ to ensure, that the session does not die on browser crashes, but still dies on session timeout.

I hope it helps.

---

<div class="post-metadata">

**Author:** ![drankinatty](https://help.nextcloud.com/letter_avatar/drankinatty/32/5_5575768a8748004e209b776fc1b2916d.png) [@drankinatty](https://help.nextcloud.com/u/drankinatty)\
**Post date:** [September 25, 2023, 12:22am UTC](https://help.nextcloud.com/t/web-session-not-expiring/60286/10 "2023-09-25T00:22:20Z")

</div>

I can confirm this is still an issue on 27.1.1. With Firefox 115esr, the session for nextcloud never times out. The `php.ini` setting for session lifetime remains in the default for 8.1 of 24 minutes, e.g. `session.gc_maxlifetime = 1440`. Even so, I can sit down in the morning and the session in nextcloud is still active. Maybe a recent change triggered a regression?

One other possible contributing factor is I also have the IOS nextcloud app in use for syncing files. That access by my account may be what is responsible for nextcloud thinking my session is still active even though the browser and IOS app would have different session IDs. If it is just checking whether there was activity by the account, then that may explain the behavior. I haven’t looked at the source in nextcloud, so I have no idea what logic is being used, these are simply a few ideas based on what I see happening and possible factors…

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 4, 2024, 10:28am UTC](https://help.nextcloud.com/t/web-session-not-expiring/60286/11 "2024-12-04T10:28:53Z")

</div>


