From c04f94965614ddad2f08e9883c6240c448931011 Mon Sep 17 00:00:00 2001 From: Lukasz Raczylo Date: Sun, 7 Sep 2025 13:01:08 +0100 Subject: [PATCH] fixup! Splitting code into multiple files with reasonable testing coverage. --- session/storage/session_store.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/session/storage/session_store.go b/session/storage/session_store.go index ce045be..b9f00a5 100644 --- a/session/storage/session_store.go +++ b/session/storage/session_store.go @@ -58,6 +58,8 @@ func NewSessionData(manager SessionManager) *SessionData { // IsDirty returns true if the session data has been modified since it was last loaded or saved. // This is used to optimize session saves by only writing when necessary. func (sd *SessionData) IsDirty() bool { + sd.sessionMutex.RLock() + defer sd.sessionMutex.RUnlock() return sd.dirty } @@ -65,6 +67,8 @@ func (sd *SessionData) IsDirty() bool { // This is used when session data hasn't changed in content but should still // trigger a session save (e.g., to ensure the cookie is re-issued). func (sd *SessionData) MarkDirty() { + sd.sessionMutex.Lock() + defer sd.sessionMutex.Unlock() sd.dirty = true }