e79d756d by astaxie

#230

1 parent 904b3703
...@@ -375,16 +375,8 @@ func (c *Controller) CheckXsrfCookie() bool { ...@@ -375,16 +375,8 @@ func (c *Controller) CheckXsrfCookie() bool {
375 } 375 }
376 376
377 func (c *Controller) XsrfFormHtml() string { 377 func (c *Controller) XsrfFormHtml() string {
378 var expire int64
379 if c.XSRFExpire > 0 {
380 expire = int64(c.XSRFExpire)
381 } else {
382 expire = int64(XSRFExpire)
383 }
384 token := GetRandomString(15)
385 c.SetSecureCookie(XSRFKEY, "_xsrf", token, expire)
386 return "<input type=\"hidden\" name=\"_xsrf\" value=\"" + 378 return "<input type=\"hidden\" name=\"_xsrf\" value=\"" +
387 token + "\"/>" 379 c._xsrf_token + "\"/>"
388 } 380 }
389 381
390 func (c *Controller) GoToFunc(funcname string) { 382 func (c *Controller) GoToFunc(funcname string) {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!