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
31bdb793
authored
2014-01-05 15:21:50 +0800
by
astaxie
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
make fix
1 parent
9cbd4757
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
beego.go
router.go
beego.go
View file @
31bdb79
...
...
@@ -4,6 +4,7 @@ import (
"net/http"
"path"
"path/filepath"
"strconv"
"strings"
"github.com/astaxie/beego/middleware"
...
...
@@ -194,13 +195,13 @@ func Run() {
sessionConfig
:=
AppConfig
.
String
(
"sessionConfig"
)
if
sessionConfig
==
""
{
sessionConfig
=
`{"cookieName":`
+
SessionName
+
`,`
+
`"gclifetime":`
+
SessionGCMaxLifetime
+
`,`
+
`"gclifetime":`
+
strconv
.
FormatInt
(
SessionGCMaxLifetime
,
10
)
+
`,`
+
`"providerConfig":`
+
SessionSavePath
+
`,`
+
`"secure":`
+
HttpTLS
+
`,`
+
`"secure":`
+
strconv
.
FormatBool
(
HttpTLS
)
+
`,`
+
`"sessionIDHashFunc":`
+
SessionHashFunc
+
`,`
+
`"sessionIDHashKey":`
+
SessionHashKey
+
`,`
+
`"enableSetCookie":`
+
SessionAutoSetCookie
+
`,`
+
`"cookieLifeTime":`
+
SessionCookieLifeTime
+
`,}`
`"enableSetCookie":`
+
strconv
.
FormatBool
(
SessionAutoSetCookie
)
+
`,`
+
`"cookieLifeTime":`
+
strconv
.
Itoa
(
SessionCookieLifeTime
)
+
`,}`
}
GlobalSessions
,
_
=
session
.
NewManager
(
SessionProvider
,
sessionConfig
)
...
...
router.go
View file @
31bdb79
...
...
@@ -529,7 +529,7 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
// session init
if
SessionOn
{
context
.
Input
.
CruSession
=
GlobalSessions
.
SessionStart
(
w
,
r
)
defer
context
.
Input
.
CruSession
.
SessionRelease
()
defer
context
.
Input
.
CruSession
.
SessionRelease
(
w
)
}
if
!
utils
.
InSlice
(
strings
.
ToLower
(
r
.
Method
),
HTTPMETHOD
)
{
...
...
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