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
2bc70f62
Commit
2bc70f62
authored
Feb 21, 2014
by
asta.xie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
delete MaxAge cookielifeTime replace
parent
8bf0e67b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
session.go
session/session.go
+7
-8
No files found.
session/session.go
View file @
2bc70f62
...
...
@@ -56,11 +56,10 @@ type managerConfig struct {
EnableSetCookie
bool
`json:"enableSetCookie,omitempty"`
Gclifetime
int64
`json:"gclifetime"`
Maxlifetime
int64
`json:"maxLifetime"`
Maxage
int
`json:"maxage"`
Secure
bool
`json:"secure"`
SessionIDHashFunc
string
`json:"sessionIDHashFunc"`
SessionIDHashKey
string
`json:"sessionIDHashKey"`
CookieLifeTime
int
64
`json:"cookieLifeTime"`
CookieLifeTime
int
`json:"cookieLifeTime"`
ProviderConfig
string
`json:"providerConfig"`
}
...
...
@@ -125,8 +124,8 @@ func (manager *Manager) SessionStart(w http.ResponseWriter, r *http.Request) (se
Path
:
"/"
,
HttpOnly
:
true
,
Secure
:
manager
.
config
.
Secure
}
if
manager
.
config
.
Maxag
e
>=
0
{
cookie
.
MaxAge
=
manager
.
config
.
Maxag
e
if
manager
.
config
.
CookieLifeTim
e
>=
0
{
cookie
.
MaxAge
=
manager
.
config
.
CookieLifeTim
e
}
if
manager
.
config
.
EnableSetCookie
{
http
.
SetCookie
(
w
,
cookie
)
...
...
@@ -144,8 +143,8 @@ func (manager *Manager) SessionStart(w http.ResponseWriter, r *http.Request) (se
Path
:
"/"
,
HttpOnly
:
true
,
Secure
:
manager
.
config
.
Secure
}
if
manager
.
config
.
Maxag
e
>=
0
{
cookie
.
MaxAge
=
manager
.
config
.
Maxag
e
if
manager
.
config
.
CookieLifeTim
e
>=
0
{
cookie
.
MaxAge
=
manager
.
config
.
CookieLifeTim
e
}
if
manager
.
config
.
EnableSetCookie
{
http
.
SetCookie
(
w
,
cookie
)
...
...
@@ -206,8 +205,8 @@ func (manager *Manager) SessionRegenerateId(w http.ResponseWriter, r *http.Reque
cookie
.
HttpOnly
=
true
cookie
.
Path
=
"/"
}
if
manager
.
config
.
Maxag
e
>=
0
{
cookie
.
MaxAge
=
manager
.
config
.
Maxag
e
if
manager
.
config
.
CookieLifeTim
e
>=
0
{
cookie
.
MaxAge
=
manager
.
config
.
CookieLifeTim
e
}
http
.
SetCookie
(
w
,
cookie
)
r
.
AddCookie
(
cookie
)
...
...
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