Hans Nieuwenhuis:
but why do the global vars loose there value when i declare them and do they keep there values when i do not declare them
As long as you’re not authenticated the main solution isn’t executed and therefore the declaration of variables not executed.
As soon as they are declared, they will get the initial value as described in the declaration.
I don’t know which version you’re running, but in 6.x I’d expect Servoy to have buildmarkers on duplicate named global variables.
Assuming that your login solution is a module of your main solution and not (also) the other way around, how can the login solution access the global defined in the main solution?
Modules cannot access stuff from their calling solutions/modules.
I guess when you use a global with that name in the login solution, it is not the same global var.
And when switching to the main solution the real global var is used which is new in that scenario.
If you want to keep some state from the login solution to the main solution the global has to be declared in the login solution (or in one of its modules).