Session Expired happening more often

I’ve started, sometime in the last month or so, getting session expired alerts when I run my app from inside the IDE. I’d never seen that before, so I figured it was a temporary thing. It’s still happening, though, so I figured I’d see if anyone else was getting odd session expired messages.

1 Like

I guess nobody else is seeing this? Pretty much every time I run my app, whether through the IDE or standalone, if it’s been a while I get session expired. The app has not been running all the time in a tab, though, it’s a new tab and new session, but it still tells me the session has expired and forces a refresh.

I haven’t seen that problem.
Is it only on one computer or spread to other users?

Perhaps the app you are using is ok, but it’s sharing the authentication with another app that is kicking you out?

I would compare the user settings of all the apps running on that browser on the same day.

I would try deleting all the cookies for anvil.works or anvil.app or whatever domain the app is running on.

2 Likes

Any computer I use has the issue. This app doesn’t share authentication with any other apps.

I also have a timed ping on the main form to keep the session alive. But that timer fires every 5 minutes, and I get the session expired message immediately upon running the app.

This is new behavior. I’ve been wracking my mind trying to figure out what I might have changed to cause it. But it’s been happening for a month or so now, and I initially thought it was just a temporary issue.

I’ll play around with cookies. Maybe something from an old version of the app is hanging around in those?

Update: I cleared all the cookies with anvil in the name, waited enough time, and tried the app again. Immediately got the Session Expired message when trying to access the current user.

Update2: It only seems to be happening with the one app. I disabled the server ping just in case that was causing an issue, but that had no effect.

Can someone who knows Anvil internals explain under what situations I’m supposed to see the Session Expired message? That might help me track down what I’m doing that’s causing it to happen.

1 Like

I have the same problem with one of my apps, but only in Firefox. Works fine in Chrome.

Hi Hans and jshaffstall: Since yesterday (April 12, 2025) I have the same problem. Using FF on Win11 (can give details if helpful). Funnily, the app (under development) works fine once published even in FF) but starting it from within the IDE the moment I access the anvil.server I get the Session expired msg. Will try the Chrome workaround since the round trip to the published version is pretty hopeless during development. The published version is here (https://nutritious-zesty-charity.anvil.app/) and if anyone tells me how to send a clone link to my app I will do so - if anyone cares to take a look.
BTW no privacy badger and no change to FF since this behavior started.

1 Like

With Patricia’s help I was able to solve the problem in Firefox by deleting all browsing data and cookies, including site data and saved form info.

1 Like