Am 19.08.2014 02:40, schrieb Nick Sabalausky:
I'm updating some pre-0.7.19 code to current vibe, and I had been
relying on "request.session is null" to check whether a session had been
created.With the new struct-based Session, is there an equivalent way to check
if I have created a session for the current request? Or is there
always an implicit session and I just have to use a custom session
value like "haveIInitedThisSession_Yet" to accomplish the same thing?
It has a (now also documented) bool opCast()
that should make the struct
approach interchangeable in most cases with the class
approach.
BTW, if you should ever use the vibe.web.web
module (which really can
make the code a lot more concise) and its SessionVar!T
, there it does
indeed work with an implicitly (on write) created session, so you need
to have some variable to check if the user is actually logged in.