mirror of
https://github.com/kataras/iris.git
synced 2025-12-20 03:17:04 +00:00
publish v12.2.0-alpha6
This commit is contained in:
@@ -15,23 +15,21 @@ import (
|
||||
)
|
||||
|
||||
func newApp() *iris.Application {
|
||||
app := iris.New()
|
||||
|
||||
cookieName := "_session_id"
|
||||
// AES only supports key sizes of 16, 24 or 32 bytes.
|
||||
// You either need to provide exactly that amount or you derive the key from what you type in.
|
||||
hashKey := securecookie.GenerateRandomKey(64)
|
||||
blockKey := securecookie.GenerateRandomKey(32)
|
||||
s := securecookie.New(hashKey, blockKey)
|
||||
|
||||
mySessions := sessions.New(sessions.Config{
|
||||
Cookie: cookieName,
|
||||
Encoding: s,
|
||||
AllowReclaim: true,
|
||||
})
|
||||
|
||||
app = example.NewApp(mySessions)
|
||||
return app
|
||||
// mySessions.UseDatabase(...see sessions/database example folder)
|
||||
|
||||
return example.NewApp(mySessions)
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
||||
Reference in New Issue
Block a user