Newbie - Error message: Session expired

Hello everyone,

I have a problem with Matomo. After installing and inserting the code snippet you get this message in the dashboard and everywhere else in Matomo:

Your session has expired due to inactivity. Please log in to continue.

But a new login does not help, the same error will occur.
I have deleted the database and the Matomo folder and set everything up again (website is new)
Same error again.

I also have Matomo running at another hoster, everything works there. The following 2 things are now different:

I am this time at Host Europe
It could be that you have to set something here that is pre-configured at my other hoster.

i have built the websites with .php this time instead of .html, does it make a difference?

Otherwise I can say that the code snippet is included in the head-tag via php, this is also visible in the page source code, so it is delivered correctly.
The page is redirected to non-www and https, that’s what I specified during installation:
https://example.de
Could this be the error? I’m not sure, but I think this is how I specified it with the other hosters and that’s where it works.

Unfortunately I couldn’t find anything by searching with Google, is the error known to anyone?
I am a little bit helpless concerning a solution.

Thanks in advance!

Sorry for the bad english, I used deepl.
Here is the original in german:

https://forum.matomo.org/t/neuling-fehlermeldung-sitzung-abgelaufen/39269

Hey, I know it’s been a while so maybe you got this figured out, but I had the same issue and found out how to fix it. I had my .htaccess file set to not show the .php and .html ending of pages with these lines:

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R] # <- for test, for prod use [L,R=301]

RewriteCond %{THE_REQUEST} /([^.]+).html [NC]
RewriteRule ^ /%1 [NC,L,R]

RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^ %{REQUEST_URI}.html [NC,L]

RewriteCond %{THE_REQUEST} /([^.]+).php [NC]
RewriteRule ^ /%1 [NC,L,R]

RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^ %{REQUEST_URI}.php [NC,L]

Commenting those lines out, the error was fixed, but I still needed to not show the .php and .html endings on my web pages, so I changed those lines to:

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php [NC,L]

RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.*)$ $1.html [NC,L]

And now Matomo works just as it should. Hope this helps.

1 Like

Hey,
thank you very much! I replaced the appropriate lines in the .htaccess and it worked. Thank you very much for your help I am really happy! I hope you had a nice christmas and wish you a good start into the new year. Stay healthy!