Global Variables reset after leaving page

Context: I’m working on an app for a project.

I assigned a value to a global variable under the Panel State changed event, but when I leave the page through a button, which opens link to another page, the assigned value gets reset to nothing. My login page’s global variables work but every other global variable doesn’t.

My previous version of my project, which had the exact same IF/ELSE and action configuration, worked perfectly fine but for some reason this newer version just has this bug.

I’ve tried changing the IF/ELSE, deleting and creating the variable, assigning an initial value to the global variable, previewing in different browsers but nothing works.

I also noticed that the preview page navigation menu has no pages, dk if this bug is related or not.

Idk what is the problem but all I can say is that my project somehow got variable dementia.

Similar to another forum post Global Variables Reset On Page Load