注意:这种方式依赖 Controller
func (this *LoginController) Get() {
uname := this.GetString("uname")
//设置
this.SetSession("username", uname)
//读取
username := this.GetSession("username")
//删除
this.DelSession("username")
this.TplName = "login.html"
}
注意:这种方式依赖 Controller
func (this *LoginController) Get() {
uname := this.GetString("uname")
//设置
this.SetSession("username", uname)
//读取
username := this.GetSession("username")
//删除
this.DelSession("username")
this.TplName = "login.html"
}