On 8/19/2014 2:44 AM, Sönke Ludwig wrote:

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.

Ahh, yea, I totally missed that. Thanks.

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.

Good to know. I'll look into that more. SessionVar is a relatively new
thing isn't it? I've been sidetracked on other things for awhile so a
lot of my vibe stuff (and vibe knowledge) has bitrotted slightly. Last
thing I remember was that vibe sessions didn't really support typed
data, it was all stings IIRC.