1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-09 21:15:56 +00:00
Former-commit-id: 7b5d5530279789a3118190feb57776948b305662
This commit is contained in:
Gerasimos (Makis) Maropoulos
2019-06-07 21:07:08 +03:00
parent 9c92952a40
commit 7af5f139e0
40 changed files with 73 additions and 73 deletions

View File

@@ -17,7 +17,7 @@ type Encoding interface {
// Encode the cookie value if not nil.
// Should accept as first argument the cookie name (config.Name)
// as second argument the server's generated session id.
// Should return the new session id, if error the session id setted to empty which is invalid.
// Should return the new session id, if error the session id set to empty which is invalid.
//
// Note: Errors are not printed, so you have to know what you're doing,
// and remember: if you use AES it only supports key sizes of 16, 24 or 32 bytes.
@@ -47,10 +47,10 @@ type (
Cookie string
// CookieSecureTLS set to true if server is running over TLS
// and you need the session's cookie "Secure" field to be setted true.
// and you need the session's cookie "Secure" field to be set true.
//
// Note: The user should fill the Decode configuation field in order for this to work.
// Recommendation: You don't need this to be setted to true, just fill the Encode and Decode fields
// Recommendation: You don't need this to be set to true, just fill the Encode and Decode fields
// with a third-party library like secure cookie, example is provided at the _examples folder.
//
// Defaults to false.
@@ -67,7 +67,7 @@ type (
// Encode the cookie value if not nil.
// Should accept as first argument the cookie name (config.Cookie)
// as second argument the server's generated session id.
// Should return the new session id, if error the session id setted to empty which is invalid.
// Should return the new session id, if error the session id set to empty which is invalid.
//
// Note: Errors are not printed, so you have to know what you're doing,
// and remember: if you use AES it only supports key sizes of 16, 24 or 32 bytes.

View File

@@ -44,7 +44,7 @@ func (r *Service) CloseConnection() error {
}
// Set sets a key-value to the redis store.
// The expiration is setted by the MaxAgeSeconds.
// The expiration is set by the MaxAgeSeconds.
func (r *Service) Set(key string, value interface{}, secondsLifetime int64) (err error) {
c := r.pool.Get()
defer c.Close()

View File

@@ -92,7 +92,7 @@ func testSessions(t *testing.T, sess *sessions.Sessions, app *iris.Application)
d := e.GET("/destroy").Expect().Status(iris.StatusOK)
d.JSON().Object().Empty()
// This removed: d.Cookies().Empty(). Reason:
// httpexpect counts the cookies setted or deleted at the response time, but cookie is not removed, to be really removed needs to SetExpire(now-1second) so,
// httpexpect counts the cookies set or deleted at the response time, but cookie is not removed, to be really removed needs to SetExpire(now-1second) so,
// test if the cookies removed on the next request, like the browser's behavior.
e.GET("/after_destroy").Expect().Status(iris.StatusOK).Cookies().Empty()
// set and clear again