From 94b38db078b3ffc1db90cceaa38230fdde8b1548 Mon Sep 17 00:00:00 2001 From: Sergio Andres Virviescas Santana Date: Tue, 25 Aug 2020 11:18:28 +0200 Subject: [PATCH] Fix Store.GetSessionID concurrency reads --- store.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/store.go b/store.go index 83dd1f1..084a63f 100644 --- a/store.go +++ b/store.go @@ -63,7 +63,11 @@ func (s *Store) Flush() { // GetSessionID returns the session id func (s *Store) GetSessionID() []byte { - return s.sessionID + s.lock.RLock() + id := s.sessionID + s.lock.RUnlock() + + return id } // SetSessionID sets the session id