1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-08 20:41:57 +00:00

Merge pull request #693 from corebreaker/session-expiration

Fix up for sessions

Former-commit-id: 12b18902b4776335053b4d971ec564a9659a4c2d
This commit is contained in:
Gerasimos (Makis) Maropoulos
2017-08-01 13:13:09 +03:00
committed by GitHub
8 changed files with 262 additions and 93 deletions

View File

@@ -65,5 +65,10 @@ func main() {
sess.Destroy(ctx)
})
app.Get("/update", func(ctx context.Context) {
// updates expire date with a new date
sess.ShiftExpiraton(ctx)
})
app.Run(iris.Addr(":8080"))
}

View File

@@ -62,10 +62,16 @@ func newApp() *iris.Application {
mySessions.Start(ctx).Clear()
})
app.Get("/update", func(ctx context.Context) {
// updates expire date with a new date
mySessions.ShiftExpiraton(ctx)
})
app.Get("/destroy", func(ctx context.Context) {
//destroy, removes the entire session data and cookie
mySessions.Destroy(ctx)
}) // Note about destroy:
})
// Note about destroy:
//
// You can destroy a session outside of a handler too, using the:
// mySessions.DestroyByID

View File

@@ -69,6 +69,11 @@ func main() {
sess.Start(ctx).Clear()
})
app.Get("/update", func(ctx context.Context) {
// updates expire date
sess.ShiftExpiraton(ctx)
})
app.Get("/destroy", func(ctx context.Context) {
//destroy, removes the entire session data and cookie