8ed45951 by astaxie

Merge pull request #591 from luosangnanka/master

Update Session package README.md
2 parents e307bd7b 25768f01
...@@ -35,14 +35,14 @@ Then in you web app init the global session manager ...@@ -35,14 +35,14 @@ Then in you web app init the global session manager
35 * Use **file** as provider, the last param is the path where you want file to be stored: 35 * Use **file** as provider, the last param is the path where you want file to be stored:
36 36
37 func init() { 37 func init() {
38 globalSessions, _ = session.NewManager("file",`{"cookieName":"gosessionid","gclifetime":3600,"ProviderConfig","./tmp"}`) 38 globalSessions, _ = session.NewManager("file",`{"cookieName":"gosessionid","gclifetime":3600,"ProviderConfig":"./tmp"}`)
39 go globalSessions.GC() 39 go globalSessions.GC()
40 } 40 }
41 41
42 * Use **Redis** as provider, the last param is the Redis conn address,poolsize,password: 42 * Use **Redis** as provider, the last param is the Redis conn address,poolsize,password:
43 43
44 func init() { 44 func init() {
45 globalSessions, _ = session.NewManager("redis", `{"cookieName":"gosessionid","gclifetime":3600,"ProviderConfig","127.0.0.1:6379,100,astaxie"}`) 45 globalSessions, _ = session.NewManager("redis", `{"cookieName":"gosessionid","gclifetime":3600,"ProviderConfig":"127.0.0.1:6379,100,astaxie"}`)
46 go globalSessions.GC() 46 go globalSessions.GC()
47 } 47 }
48 48
...@@ -50,7 +50,7 @@ Then in you web app init the global session manager ...@@ -50,7 +50,7 @@ Then in you web app init the global session manager
50 50
51 func init() { 51 func init() {
52 globalSessions, _ = session.NewManager( 52 globalSessions, _ = session.NewManager(
53 "mysql", `{"cookieName":"gosessionid","gclifetime":3600,"ProviderConfig","username:password@protocol(address)/dbname?param=value"}`) 53 "mysql", `{"cookieName":"gosessionid","gclifetime":3600,"ProviderConfig":"username:password@protocol(address)/dbname?param=value"}`)
54 go globalSessions.GC() 54 go globalSessions.GC()
55 } 55 }
56 56
...@@ -58,7 +58,7 @@ Then in you web app init the global session manager ...@@ -58,7 +58,7 @@ Then in you web app init the global session manager
58 58
59 func init() { 59 func init() {
60 globalSessions, _ = session.NewManager( 60 globalSessions, _ = session.NewManager(
61 "cookie", `{"cookieName":"gosessionid","enableSetCookie":false,gclifetime":3600,"ProviderConfig":"{\"cookieName\":\"gosessionid\",\"securityKey\":\"beegocookiehashkey\"}"}`) 61 "cookie", `{"cookieName":"gosessionid","enableSetCookie":false,"gclifetime":3600,"ProviderConfig":"{\"cookieName\":\"gosessionid\",\"securityKey\":\"beegocookiehashkey\"}"}`)
62 go globalSessions.GC() 62 go globalSessions.GC()
63 } 63 }
64 64
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!