越诚云API

Session存取

检查key是否存在

var key = "loginUser";
var exist  = _webParams.getSessionItem().containsKey(key);
if(exist){....}

根据key获取Session对象

var data = _webParams.getSessionItem().get("loginUser");
if(data != null){
   var name = data.get("username");
}

设置Session

var data = _db.findData("cms","user","123456");
if(data != null){
   _webParams.getSessionItem().put("loginUser",data);
}

移除Session

_webParams.getSessionItem().remove("loginUser");