From http://code.google.com/p/gorilla/issues/detail?id=53 I’m writing a small web-app and I noticed that during testing, I sometimes got the error message "2012/09/27 15:25:50 session error: securecookie: the value could not be decoded" …and my session contents were lost. After a bit of digging, this happens when you write session contents which are _smaller_ than the previous contents. It can be easily fixed by using os.O_TRUNC in func (s *FilesystemStore) save(session *Session) (sessions/store.go:198): ``` fp, err2 := os.OpenFile(filename, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600) ``` Please apply this fix upstream. Thanks!
Activity