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
6e9ba0ea
Commit
6e9ba0ea
authored
Jan 11, 2014
by
slene
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix SessionRegenerateID should release old SessionStore and release new SessionStore in router.go
parent
3b99f37a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
controller.go
controller.go
+2
-1
router.go
router.go
+3
-1
No files found.
controller.go
View file @
6e9ba0ea
...
@@ -165,7 +165,7 @@ func (c *Controller) RenderBytes() ([]byte, error) {
...
@@ -165,7 +165,7 @@ func (c *Controller) RenderBytes() ([]byte, error) {
if
c
.
LayoutSections
!=
nil
{
if
c
.
LayoutSections
!=
nil
{
for
sectionName
,
sectionTpl
:=
range
c
.
LayoutSections
{
for
sectionName
,
sectionTpl
:=
range
c
.
LayoutSections
{
if
(
sectionTpl
==
""
)
{
if
sectionTpl
==
""
{
c
.
Data
[
sectionName
]
=
""
c
.
Data
[
sectionName
]
=
""
continue
continue
}
}
...
@@ -391,6 +391,7 @@ func (c *Controller) DelSession(name interface{}) {
...
@@ -391,6 +391,7 @@ func (c *Controller) DelSession(name interface{}) {
// SessionRegenerateID regenerates session id for this session.
// SessionRegenerateID regenerates session id for this session.
// the session data have no changes.
// the session data have no changes.
func
(
c
*
Controller
)
SessionRegenerateID
()
{
func
(
c
*
Controller
)
SessionRegenerateID
()
{
c
.
CruSession
.
SessionRelease
(
c
.
Ctx
.
ResponseWriter
)
c
.
CruSession
=
GlobalSessions
.
SessionRegenerateId
(
c
.
Ctx
.
ResponseWriter
,
c
.
Ctx
.
Request
)
c
.
CruSession
=
GlobalSessions
.
SessionRegenerateId
(
c
.
Ctx
.
ResponseWriter
,
c
.
Ctx
.
Request
)
c
.
Ctx
.
Input
.
CruSession
=
c
.
CruSession
c
.
Ctx
.
Input
.
CruSession
=
c
.
CruSession
}
}
...
...
router.go
View file @
6e9ba0ea
...
@@ -529,7 +529,9 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
...
@@ -529,7 +529,9 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
// session init
// session init
if
SessionOn
{
if
SessionOn
{
context
.
Input
.
CruSession
=
GlobalSessions
.
SessionStart
(
w
,
r
)
context
.
Input
.
CruSession
=
GlobalSessions
.
SessionStart
(
w
,
r
)
defer
context
.
Input
.
CruSession
.
SessionRelease
(
w
)
defer
func
()
{
context
.
Input
.
CruSession
.
SessionRelease
(
w
)
}()
}
}
if
!
utils
.
InSlice
(
strings
.
ToLower
(
r
.
Method
),
HTTPMETHOD
)
{
if
!
utils
.
InSlice
(
strings
.
ToLower
(
r
.
Method
),
HTTPMETHOD
)
{
...
...
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