Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
张磊
/
FileStorageBeego
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
9cbd4757
authored
2014-01-05 14:59:39 +0800
by
astaxie
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
beego support new version session
1 parent
481448fa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
7 deletions
beego.go
config.go
beego.go
View file @
9cbd475
...
...
@@ -191,14 +191,19 @@ func Run() {
}
if
SessionOn
{
sessionConfig
:=
AppConfig
.
String
(
"sessionConfig"
)
if
sessionConfig
==
""
{
sessionConfig
=
`{"cookieName":`
+
SessionName
+
`,`
+
`"gclifetime":`
+
SessionGCMaxLifetime
+
`,`
+
`"providerConfig":`
+
SessionSavePath
+
`,`
+
`"secure":`
+
HttpTLS
+
`,`
+
`"sessionIDHashFunc":`
+
SessionHashFunc
+
`,`
+
`"sessionIDHashKey":`
+
SessionHashKey
+
`,`
+
`"enableSetCookie":`
+
SessionAutoSetCookie
+
`,`
+
`"cookieLifeTime":`
+
SessionCookieLifeTime
+
`,}`
}
GlobalSessions
,
_
=
session
.
NewManager
(
SessionProvider
,
SessionName
,
SessionGCMaxLifetime
,
SessionSavePath
,
HttpTLS
,
SessionHashFunc
,
SessionHashKey
,
SessionCookieLifeTime
)
sessionConfig
)
go
GlobalSessions
.
GC
()
}
...
...
config.go
View file @
9cbd475
...
...
@@ -40,6 +40,7 @@ var (
SessionHashFunc
string
// session hash generation func.
SessionHashKey
string
// session hash salt string.
SessionCookieLifeTime
int
// the life time of session id in cookie.
SessionAutoSetCookie
bool
// auto setcookie
UseFcgi
bool
MaxMemory
int64
EnableGzip
bool
// flag of enable gzip
...
...
@@ -96,6 +97,7 @@ func init() {
SessionHashFunc
=
"sha1"
SessionHashKey
=
"beegoserversessionkey"
SessionCookieLifeTime
=
0
//set cookie default is the brower life
SessionAutoSetCookie
=
true
UseFcgi
=
false
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment