Hi @lee.matias,
Have you managed to solve you problem?
I’m having the same issue.
I tried to switch to the latest working version, and the problem appeared there too!
It works correctly if I run the app from the development environment but in a new tab, which is a temporary workaround.
My app uses a cookie to store a row id between sessions, when I delete this cookie it works again, but I have to do it before each run.
I’m having the problem in Firefox 108.0 on Windows 11. I’ve tried Chrome and it works correctly.
I’m using the Beta Editor. The problem arises when I run the app in split view or maximized view. It doesn’t happen when I run in a new tab or in the published app.
I’ve tried the classic editor, same problem.
My app uses a cookie to save a row ID and retrieve data between sessions. When I delete that cookie, the following run works normally. And then the issue reappears in the next run.
1 - I am using firefox.
2 - The same happens in both editors. In the old version, I press RUN and a full-size window is opened. In the new version, I press RUN and the window is opened in the right sector of the browser.
BTW, in my firefox I have 4 different google accounts running at the same time. I think this is the problem and for that reason using private mode works well.
Next question (I appreciate this sounds strange but I promise you we’re working a theory, to do with how Firefox specifically has changed cookie handling in iframes):
@charles.e.georges can I ask you to be very specific - when you say “I delete that cookie” what steps do you actually go through in Firefox?
For all: Does this problem happen with every app you run, or only some apps? And do your apps do anything that opens a pop-up outside the editor (I’m thinking particularly Google/Microsoft/etc logins).
The good news is that for now this problem can apparently be worked around by using Chrome. We still haven’t managed to reproduce it on this end, but your answers here are helping!
About 2, I only have one app. The problem happened when I wanted to log in with one of my google accounts (the app open a pop-up to choose the account). I tried again and the problem looks as solved in Firefox. Nice work!
Settings > Privacy and Security > Cookies and site data > Manage date
then I search for anvil, I see 2 lines anvil.works and anvil.app. I select anvil.app then I click on Remove selected, Save changes, Remove.
After that, I can run the app in split view and it will work. But it creates a new cookie and when I run it again, I get the Session expired popup.
I tried my two other apps, the problem doesn’t happen.
None of my apps have login popups, but two of them have popup forms made using alert(), but one of them works perfectly and even for the one that has the problem, the problem appears on a page where there is no such form.
I made further investigations by commenting out any code that has to do with storing and retrieving my cookie and the problem still occurs.
I then checked the cookies with Firefox inspection tool and it seems that as soon as I run the app, 3 cookies are created automatically.
Currently, i am using workaround by placing a function call before any call to server. In dev environment, that function has anvil.server.reset_session(), which just solves my problem
Whenever i want to make a release, i just comment the part of code that resets session
I can confirm I’ve got this issue reproduced on the latest Firefox, so we’ll run it down. It’s Christmas Eve, so I can’t guarantee an immediate resolution, but we’ll get on it when the Christmas pudding wears off!
For now, the workaround is to use the Beta Editor, and to choose Run in new tab:
(Or, of course, to use Chrome or a Chrome-based browser.)
I’ve been having this issue too for ages - finally got round to searching the forums for it today and found this. I’m also using Firefox. If I can help debug in any way let me know.
I also have the same problem, but not for all browsers/apps.
Specifically: Firefox (on Macs, latest os).
Tried to turn off all kinds of blockers, clear cache, updates etc. Still a problem.
No problems in Chrome.
Weakly founded hypothesis: Apps that use the login form (and specifically when using google login) seem to run fine the first time, but then cause problem on the second run. Simple apps with no login worked fine (tested only one …).