Vadim Gritsenko wrote:
...
What if those variables *are* global? If they are stored in the session they become local to the current user.The intention is that they are per-user state, so storing them in the session makes sense.
See example in this thread with var role = .........ROLE;
These kind of variables are not local to the current user. You can also have some other application-wide variables.
The "role" variable itself is writeable (although the value assigned to it was a constant). Thus, it must be per-user.
And clearly the intent was not to have the variable change value. Is there a better way in the current situation to access that static global information without a session? I suppose I could pass it as a parameter from the sitemap as a string? What is the better solution?
Back to Antonio's suggestion. Can we have a configuration of the flow controller specifying where to store those global variables? Context, session, and request (that should be analogue to "no session", right?) can be possible values.
Where would you specify this, exactly?
Geoff suggested couple of places:
This seems to be a good solution too, as long as it's not once per application. It seems it would need to be on <map:flow> or <map:call>?
I think map:flow is appropriate.
+0 to turning on/off session creation in <map:flow>.
-1 to having "request" or "context" scope.
Again, this would seem fine to me. I'm not sure I totally understand the problem with context scope (though request I think I understand). What potential for abuse or error do you see?
Geoff