1
0
mirror of https://github.com/kataras/iris.git synced 2026-03-10 18:35:57 +00:00

Fix tests

This commit is contained in:
Makis Maropoulos
2016-07-08 22:11:39 +02:00
parent 68111f57d1
commit 40ab94a9fc
2 changed files with 21 additions and 4 deletions

View File

@@ -744,15 +744,20 @@ func (ctx *Context) SetCookieKV(key, value string) {
// RemoveCookie deletes a cookie by it's name/key
func (ctx *Context) RemoveCookie(name string) {
ctx.Response.Header.DelCookie(name)
cookie := fasthttp.AcquireCookie()
cookie.SetKey(name)
cookie.SetValue("")
cookie.SetPath("/")
cookie.SetHTTPOnly(true)
exp := time.Now().Add(-time.Duration(1) * time.Minute) //RFC says 1 second, but make sure 1 minute because we are using fasthttp
exp := time.Now().Add(-time.Duration(1) * time.Minute) //RFC says 1 second, but let's do it 1 minute to make sure is working...
cookie.SetExpire(exp)
ctx.Response.Header.SetCookie(cookie)
fasthttp.ReleaseCookie(cookie)
// delete respone's cookie also, which is temporarly available
ctx.Request.Header.DelCookie(name)
}
// GetFlashes returns all the flash messages for available for this request