1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 21:20:54 +00:00
This commit is contained in:
astaxie 2013-09-28 22:22:54 +08:00
parent 904b37032c
commit e79d756d06

View File

@ -375,16 +375,8 @@ func (c *Controller) CheckXsrfCookie() bool {
} }
func (c *Controller) XsrfFormHtml() string { func (c *Controller) XsrfFormHtml() string {
var expire int64
if c.XSRFExpire > 0 {
expire = int64(c.XSRFExpire)
} else {
expire = int64(XSRFExpire)
}
token := GetRandomString(15)
c.SetSecureCookie(XSRFKEY, "_xsrf", token, expire)
return "<input type=\"hidden\" name=\"_xsrf\" value=\"" + return "<input type=\"hidden\" name=\"_xsrf\" value=\"" +
token + "\"/>" c._xsrf_token + "\"/>"
} }
func (c *Controller) GoToFunc(funcname string) { func (c *Controller) GoToFunc(funcname string) {