On Fri, 06 Jun 2014 13:12:48 +0200, Sönke Ludwig wrote:
On a second thought, it's probably better to generally disallow
class
,
as well as other mutable reference types. This kind ofclass
approach
works fine with theMemorySessionStore
, but will fail miserably when
for example storing the session data in a Redis database or similar. So
I think I'll add a check with the suggestion to use astruct
instead.And for safety reasons, it would also be better to have the getter of
SessionVar
always return aconst
value, so that no hidden no-ops are
possible (e.g.sessionvar.someStructField = 42;
would only set 42 on a
temporary, but not in the session store).
Fixed behavior and updated the web example: 532c468