aboutsummaryrefslogtreecommitdiff
path: root/store.go
diff options
context:
space:
mode:
authorKamil Kisiel <kamil@kamilkisiel.net>2013-07-09 03:08:57 +0400
committerKamil Kisiel <kamil@kamilkisiel.net>2013-07-09 03:10:05 +0400
commitee375ad9efa3c4d4eb23eb79dd8f083596460edb (patch)
tree5a885ba45b87113f32d4d58cd8498adceeca23c6 /store.go
parentc044c93603af0d545821becf4fae68ea969eb074 (diff)
Copy store options to sessions instead of referencing them.
Fixes GH-8
Diffstat (limited to 'store.go')
-rw-r--r--store.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/store.go b/store.go
index 8d00cb3..fe31c08 100644
--- a/store.go
+++ b/store.go
@@ -73,7 +73,8 @@ func (s *CookieStore) Get(r *http.Request, name string) (*Session, error) {
// decoded session after the first call.
func (s *CookieStore) New(r *http.Request, name string) (*Session, error) {
session := NewSession(s, name)
- session.Options = &(*s.Options)
+ opts := *s.Options
+ session.Options = &opts
session.IsNew = true
var err error
if c, errCookie := r.Cookie(name); errCookie == nil {
@@ -148,7 +149,8 @@ func (s *FilesystemStore) Get(r *http.Request, name string) (*Session, error) {
// See CookieStore.New().
func (s *FilesystemStore) New(r *http.Request, name string) (*Session, error) {
session := NewSession(s, name)
- session.Options = &(*s.Options)
+ opts := *s.Options
+ session.Options = &opts
session.IsNew = true
var err error
if c, errCookie := r.Cookie(name); errCookie == nil {