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
6e9ba0ea
authored
2014-01-11 17:01:33 +0800
by
slene
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix SessionRegenerateID should release old SessionStore and release new SessionStore in router.go
1 parent
3b99f37a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
controller.go
router.go
controller.go
View file @
6e9ba0e
...
...
@@ -165,7 +165,7 @@ func (c *Controller) RenderBytes() ([]byte, error) {
if
c
.
LayoutSections
!=
nil
{
for
sectionName
,
sectionTpl
:=
range
c
.
LayoutSections
{
if
(
sectionTpl
==
""
)
{
if
sectionTpl
==
""
{
c
.
Data
[
sectionName
]
=
""
continue
}
...
...
@@ -391,6 +391,7 @@ func (c *Controller) DelSession(name interface{}) {
// SessionRegenerateID regenerates session id for this session.
// the session data have no changes.
func
(
c
*
Controller
)
SessionRegenerateID
()
{
c
.
CruSession
.
SessionRelease
(
c
.
Ctx
.
ResponseWriter
)
c
.
CruSession
=
GlobalSessions
.
SessionRegenerateId
(
c
.
Ctx
.
ResponseWriter
,
c
.
Ctx
.
Request
)
c
.
Ctx
.
Input
.
CruSession
=
c
.
CruSession
}
...
...
router.go
View file @
6e9ba0e
...
...
@@ -529,7 +529,9 @@ 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
(
w
)
defer
func
()
{
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