Gerasimos (Makis) Maropoulos 2022-08-14 23:59:07 +03:00
parent f91269130e
commit 5e0bea8112
No known key found for this signature in database
GPG Key ID: 403EEB7885C79503
2 changed files with 5 additions and 4 deletions

View File

@ -5,8 +5,8 @@ import "github.com/kataras/iris/v12"
func main() {
app := iris.New()
app.Get("/", func(c iris.Context) {
c.Writef("Hello %s", "world")
app.Get("/", func(ctx iris.Context) {
ctx.Writef("Hello %s", "world")
})
// This is an Iris-only feature across all web frameworks
@ -24,7 +24,7 @@ func main() {
// http://localhost:8080 -> FOUND (Hello world)
// http://localhost:8080/other -> NOT FOUND
// http://localhost/@ -> NOT FOUND
// http://localhost:8080/@ -> NOT FOUND
// http://localhost:8080/@kataras -> FOUND (username is kataras)
app.Listen(":8080")
}

View File

@ -267,7 +267,8 @@ func (db *Database) Delete(sid string, key string) (deleted bool) {
// Clear removes all session key values but it keeps the session entry.
func (db *Database) Clear(sid string) error {
keys := db.keys(db.makeSID(sid))
sid = db.makeSID(sid)
keys := db.keys(sid)
for _, key := range keys {
if key == SessionIDKey {
continue