- Notifications
You must be signed in to change notification settings - Fork0
A session store backend for gorilla/sessions using Redis.
License
NotificationsYou must be signed in to change notification settings
no-src/redistore
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
A session store backendforgorilla/sessions -src.
The redistore project is a fork ofredistore.The purpose of this fork is to replace theredigowithgo-redis as the driver of redis store.
Depends on thego-redis Redis library.
go get -u github.com/no-src/redistore
Available onpkg.go.dev.
Seehttps://github.com/gorilla/sessions for full documentation on underlying interface.
// Fetch new store.store,err:=NewRediStore(10,"tcp",":6379","", []byte("secret-key"))iferr!=nil {panic(err)}deferstore.Close()// Get a session.session,err=store.Get(req,"session-key")iferr!=nil {log.Error(err.Error())}// Add a value.session.Values["foo"]="bar"// Save.iferr=sessions.Save(req,rsp);err!=nil {t.Fatalf("Error saving session: %v",err)}// Delete session.session.Options.MaxAge=-1iferr=sessions.Save(req,rsp);err!=nil {t.Fatalf("Error saving session: %v",err)}// Change session storage configuration for MaxAge = 10 days.store.SetMaxAge(10*24*3600)
About
A session store backend for gorilla/sessions using Redis.
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
No releases published
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.
Contributors15
Uh oh!
There was an error while loading.Please reload this page.