Skip to content

Commit

Permalink
Merge pull request beego#2961 from zhlicen/master
Browse files Browse the repository at this point in the history
Add lock while releasing session
  • Loading branch information
astaxie authored Dec 6, 2017
2 parents 3e1916e + ed73bdc commit 0fbbc67
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions session/sess_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ func (fs *FileSessionStore) SessionID() string {

// SessionRelease Write file session to local file with Gob string
func (fs *FileSessionStore) SessionRelease(w http.ResponseWriter) {
filepder.lock.Lock()
defer filepder.lock.Unlock()
b, err := EncodeGob(fs.values)
if err != nil {
SLogger.Println(err)
Expand Down

0 comments on commit 0fbbc67

Please sign in to comment.