1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-18 02:17:05 +00:00
Former-commit-id: 3ac995ea77b4629dc7b0d580b9e36d9e302b96ee
This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-05-18 18:43:39 +03:00
parent f3745cebbd
commit 9b172fe4ab
2 changed files with 34 additions and 2 deletions

View File

@@ -24,6 +24,18 @@ func main() {
defer db.Close() // close and unlock the database if application errored.
// The default transcoder is the JSON one,
// based on the https://golang.org/pkg/encoding/json/#Unmarshal
// you can only retrieve numbers as float64 types:
// * bool, for booleans
// * float64, for numbers
// * string, for strings
// * []interface{}, for arrays
// * map[string]interface{}, for objects.
// If you want to save the data per go-specific types
// you should change the DefaultTranscoder to the GobTranscoder one:
// sessions.DefaultTranscoder = sessions.GobTranscoder{}
sess := sessions.New(sessions.Config{
Cookie: "sessionscookieid",
Expires: 1 * time.Minute, // <=0 means unlimited life. Defaults to 0.