mirror of
https://github.com/astaxie/beego.git
synced 2025-06-12 11:10:40 +00:00
cache, context, session: add lock to fix inconsistent field protection
This commit is contained in:
@ -74,7 +74,9 @@ func (st *CookieSessionStore) SessionID() string {
|
||||
|
||||
// SessionRelease Write cookie session to http response cookie
|
||||
func (st *CookieSessionStore) SessionRelease(w http.ResponseWriter) {
|
||||
st.lock.Lock()
|
||||
encodedCookie, err := encodeCookie(cookiepder.block, cookiepder.config.SecurityKey, cookiepder.config.SecurityName, st.values)
|
||||
st.lock.Unlock()
|
||||
if err == nil {
|
||||
cookie := &http.Cookie{Name: cookiepder.config.CookieName,
|
||||
Value: url.QueryEscape(encodedCookie),
|
||||
|
Reference in New Issue
Block a user