Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
beego
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
beego
Commits
41633900
Commit
41633900
authored
Oct 13, 2016
by
astaxie
Committed by
GitHub
Oct 13, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2218 from WatchtowerSecurity/NameFix
Name fix
parents
aaf6e775
51b31c6c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
27 deletions
+27
-27
config.go
config.go
+24
-24
hooks.go
hooks.go
+3
-3
No files found.
config.go
View file @
41633900
...
...
@@ -86,18 +86,18 @@ type WebConfig struct {
// SessionConfig holds session related config
type
SessionConfig
struct
{
SessionOn
bool
SessionProvider
string
SessionName
string
SessionGCMaxLifetime
int64
SessionProviderConfig
string
SessionCookieLifeTime
int
SessionAutoSetCookie
bool
SessionDomain
string
SessionDisableHTTPOnly
bool
// used to allow for cross domain cookies/javascript cookies.
EnableSidInHttpHeader
bool
// enable store/get the sessionId into/from http headers
SessionNameInH
ttpHeader
string
EnableSidInUrlQuery
bool
// enable get the sessionId from Url Query params
SessionOn
bool
SessionProvider
string
SessionName
string
SessionGCMaxLifetime
int64
SessionProviderConfig
string
SessionCookieLifeTime
int
SessionAutoSetCookie
bool
SessionDomain
string
SessionDisableHTTPOnly
bool
// used to allow for cross domain cookies/javascript cookies.
SessionEnableSidInHTTPHeader
bool
// enable store/get the sessionId into/from http headers
SessionNameInH
TTPHeader
string
SessionEnableSidInURLQuery
bool
// enable get the sessionId from Url Query params
}
// LogConfig holds Log related config
...
...
@@ -222,18 +222,18 @@ func newBConfig() *Config {
XSRFKey
:
"beegoxsrf"
,
XSRFExpire
:
0
,
Session
:
SessionConfig
{
SessionOn
:
false
,
SessionProvider
:
"memory"
,
SessionName
:
"beegosessionID"
,
SessionGCMaxLifetime
:
3600
,
SessionProviderConfig
:
""
,
SessionDisableHTTPOnly
:
false
,
SessionCookieLifeTime
:
0
,
//set cookie default is the browser life
SessionAutoSetCookie
:
true
,
SessionDomain
:
""
,
EnableSidInHttpHeader
:
false
,
// enable store/get the sessionId into/from http headers
SessionNameInH
ttpHeader
:
"Beegosessionid"
,
EnableSidInUrlQuery
:
false
,
// enable get the sessionId from Url Query params
SessionOn
:
false
,
SessionProvider
:
"memory"
,
SessionName
:
"beegosessionID"
,
SessionGCMaxLifetime
:
3600
,
SessionProviderConfig
:
""
,
SessionDisableHTTPOnly
:
false
,
SessionCookieLifeTime
:
0
,
//set cookie default is the browser life
SessionAutoSetCookie
:
true
,
SessionDomain
:
""
,
SessionEnableSidInHTTPHeader
:
false
,
// enable store/get the sessionId into/from http headers
SessionNameInH
TTPHeader
:
"Beegosessionid"
,
SessionEnableSidInURLQuery
:
false
,
// enable get the sessionId from Url Query params
},
},
Log
:
LogConfig
{
...
...
hooks.go
View file @
41633900
...
...
@@ -55,9 +55,9 @@ func registerSession() error {
conf
.
ProviderConfig
=
filepath
.
ToSlash
(
BConfig
.
WebConfig
.
Session
.
SessionProviderConfig
)
conf
.
DisableHTTPOnly
=
BConfig
.
WebConfig
.
Session
.
SessionDisableHTTPOnly
conf
.
Domain
=
BConfig
.
WebConfig
.
Session
.
SessionDomain
conf
.
EnableSidInHttpHeader
=
BConfig
.
WebConfig
.
Session
.
EnableSidInHttp
Header
conf
.
SessionNameInHttpHeader
=
BConfig
.
WebConfig
.
Session
.
SessionNameInH
ttp
Header
conf
.
EnableSidInUrlQuery
=
BConfig
.
WebConfig
.
Session
.
EnableSidInUrl
Query
conf
.
EnableSidInHttpHeader
=
BConfig
.
WebConfig
.
Session
.
SessionEnableSidInHTTP
Header
conf
.
SessionNameInHttpHeader
=
BConfig
.
WebConfig
.
Session
.
SessionNameInH
TTP
Header
conf
.
EnableSidInUrlQuery
=
BConfig
.
WebConfig
.
Session
.
SessionEnableSidInURL
Query
}
else
{
if
err
=
json
.
Unmarshal
([]
byte
(
sessionConfig
),
conf
);
err
!=
nil
{
return
err
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment