美文网首页
beego框架 之 session简单使用

beego框架 之 session简单使用

作者: 大植先生 | 来源:发表于2017-04-05 11:58 被阅读0次

注意:这种方式依赖 Controller

func (this *LoginController) Get() {

 uname := this.GetString("uname")

 //设置

 this.SetSession("username", uname)

 //读取

 username := this.GetSession("username")

 //删除

 this.DelSession("username")

 this.TplName = "login.html"

}

相关文章

网友评论

      本文标题:beego框架 之 session简单使用

      本文链接:https://www.haomeiwen.com/subject/wqstattx.html