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
2bc70f62
authored
2014-02-22 01:04:47 +0800
by
asta.xie
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
delete MaxAge cookielifeTime replace
1 parent
8bf0e67b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
session/session.go
session/session.go
View file @
2bc70f6
...
...
@@ -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
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