Commit e79d756d authored by astaxie's avatar astaxie

#230

parent 904b3703
...@@ -375,16 +375,8 @@ func (c *Controller) CheckXsrfCookie() bool { ...@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment