Source: site.view [edit]
Function name: getSessionInfo
Arguments: site,sessionkey
Description: Retrieve saved user info from a session key
Page type: webl
Render function:  
Module: siteutil

Page source:

var db = Wub_GetDB(site);
var coll = Wub_GetCollection(db, "session");

if sessionkey == nil then
   sessionkey = "NONE"
end;

var dbobj = Wub_NewDBObject([. key=sessionkey .]); 
var res = Wub_QueryDB(coll, dbobj, 20);
if (Size(res) >= 1) then
   res[0].data ? nil
else
   nil;
end;