Bug with Nextcloud Web Interface: automatically unwanted logout

I am using Nextcloud 9.053 on a shared host (MySQL: 5.6.19, PHP: 5.56). Connecting to my Nextcloud server using any web browser I get the following bug, an automatically unwanted logout:

After a few clicks in the Nextclouds Web interface, especially in the Files page, I get the message:

"Problem loading the page, reloading in 5 seconds"

After 5 seconds I am logged out and have to login again. Having a look into the log-file there you can find the following entry:

"app":"no app in context","message":"Current user is not logged in"

Has anyone an idea, what is the reason for that bug and how can it be fiexed? Only the standard apps are activated.

Any browser, any system?

On my Mac with safari, I also keeo experiencing unwanted logout errors, just as you do, but i dont find those messages in the log (however, my log level is 1)

Same problem here (Nextcloud 10.0.1) on a shared hosting environment (PHP 7.0.6, MySQL 5.6.19).
I keep getting the same error, before being logged out.
This happens on a mac (10.10.5) via Safari, Chrome and Firefox. And also on win7/win10-machines with FF, Chrome and IE.

Log throws the following and nothing else:
Debug no app in context Current user is not logged in

Any ideas?

What apps have you installed?

Only the default ones:

  • Activity 2.3.2
  • Auditing / Logging 1.0.0
  • Collaborative tags 1.0.2
  • Comments 1.0.0
  • Deleted files 1.0.0
  • File sharing 1.0.0
  • First run wizard 1.1
  • Gallery 15.0.0
  • Mail template editor 0.1
  • Notifications 0.3.0
  • Password policy 1.0.0
  • PDF viewer 0.8.1
  • Provisioning API 1.0.0
  • Server info 1.1.1
  • Text editor 2.1
  • Theming 1.0.1
  • Update notification 1.0.1
  • Usage report 0.1.5
  • Versions 1.3.0
  • Video player 0.9.8

I already tried if there’s any effect by deactivating the following apps:

  • Activity 2.3.2
  • Collaborative tags 1.0.2
  • Comments 1.0.0
  • Gallery 15.0.0

But the behaviour persisted. I can’t even say if there’s a certain trigger, because this happens very randomly: very often while uploading images, rather seldom while uploading pdfs or zip-files. but also quite frequently only by navigating. for example switching from “files” to “administrator” or from “apps” to “gallery” and so on. and it also occured just by leaving the site alone and doing nothing. but that’s not a repeating pattern, like a certain time intervall or anything, just random. and the only log info i get is the one stated above.

maybe this helps further isolating the issue: this behaviour also occured on 9.0.54 before, but not as frequently as now.

and I also tried this suggested fix here:

but this only suppresses the page reload. so i have to do a manual reload and the result is the same. i am logged out after that

much obliged for any further help on that!

I have no idea. @LukasReschke can you help here?

now this is really embarrassing: i looked into my php settings for a second time. and guess what: my session.save_path wasn’t configured correctly. now everything’s working perfectly fine.

So if anyone else is experiencing this behavior: better check your php.ini (at least twice or once but then in-depth) before pulling your hair out.

I am sorry, I have to do some follow up here:

where do i find php.ini? didnt find it in my nextcloud folder… sorry, i am a beginner.

Also, since I also experience that problem of unwanted logout, is this probably related to the following error in the log:

Warning no app in context Temporary directory /kunden/XXXXX/nextcloud/tmp/ is not present or writable 2016-10-16T09:45:21+00:00

I seem to get this warning every few minutes.

Did you set an individual tmp-folder in your config.php? If you do, you also need to create it.

On most Linuxes in /etc/php*/*

Just as a minor addition to the post before:

On shared hosting environments you might find your php-settings/configuration options in your account menu. There you can choose which php-version will be used and also the correspondent settings that go along with that (–> php.ini). if you can’t find such a menu-item, you might have to ask your provider to edit those settings for you instead.

And in addition to that a huge thank you to and big respect for @tflidd and the whole support community: you are doing an amazing job!


I have the same problem and it would be awesome if you could give me some more information about the php.ini solution.

My cloud is hosted on DomainFactory and I just checked my account settings. I have no php.ini created.
Can I do that without damaging my Nextcloud installation?
Do I have to do that? Except from the beforementioned error everything runs fine. Maybe there is another solution?

Some more details would be greatly appreciated.


Had the same problem. Like @daniel I am on shared webspace at DomainFactory.

I am not sure that a missing session.save_path in php.ini is the culprit in our case.

Rather I suspect missing permissions for read access to /tmp, as @lex noted.
So I added to config/config.php a line like this, using an existing tmp folder somewhere in my home directory:

'tempdirectory' => '/kunden/.../.../tmp',

Don´t seem to work.

I got that line, yet i experience unwated logouts and also go a warning in administration that there is no cache installed (which may be something else)?

Unwanted logouts still persist in NC 10.

According to support of webhoster, “temp” is correctly configured, but i don´t know what to do next

Do you still get errors in your logfiles? The missing cache-warning is not error, most hosting solutions don’t provide caching modules (at least not redis) and they are no requirement (they make the cloud just a bit faster).

Strangely enough, the only error message i can find in the log now (logging “all”) is related to something with webdav, which sounds more like a problem with a calender or such but not a reason for an unwanted logout for a browser session?

Exception: {“Message”:“HTTP/1.1 401 No ‘Authorization: Basic’ header found. Either the client didn’t send one, or the server is mis-configured”,“Exception”:“Sabre\DAV\Exception\NotAuthenticated”,“Code”:0,“Trace”:"#0 [internal function]: Sabre\DAV\Auth\Plugin->beforeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))\n#1 /kunden/XXXX/XX/3rdparty/sabre/event/lib/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\n#2 /kunden/XXX/XXX/3rdparty/sabre/dav/lib/DAV/Server.php(446): Sabre\Event\EventEmitter->emit(‘beforeMethod’, Array)\n#3 /kunden/XXX/XX/3rdparty/sabre/dav/lib/DAV/Server.php(248): Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))\n#4 /kunden/XXX/XX/apps/dav/appinfo/v1/caldav.php(84): Sabre\DAV\Server->exec()\n#5 /kunden/XXXX/XX/remote.php(165): require_once(’/kunden/XXXXX…’)\n#6 {main}",“File”:"/kunden/XXXXXX/XX/3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php",“Line”:188,“User”:"(unsername, deleted here)"}

Hi guys, hi @tho, hi @daniel,

I am another one of those DomainFactory customers. My first approach was also adding a custom temporary directory. That solved some of my problems. But (as far as I can judge that by now) what really solved my constant unwanted logouts/relogins (to add another keyword for search engines) was changing session.save_path in php.ini:

session.save_path = /kunden/accountNumber_zipCode/tmp

If your df account is older, the folder structure might look different. More info on that: Probleme beim Owncloud Upload / session.save_path? and ownCloud: Problem mit Session Path

I hope that helps someone.


Thanks for your tip, however n trying to follow it up - where do I find “php.ini”? thanks!

Have a look here: DomainFactory FAQ – PHP.INI-Editor