Fix save function to actually update database record. Add a test.

This commit is contained in:
Hans Lawrenz
2014-05-19 10:50:30 -04:00
parent ef9866c6f5
commit 53ec9b3310
2 changed files with 102 additions and 1 deletions

View File

@@ -180,7 +180,7 @@ func (db *PGStore) save(session *sessions.Session) error {
if session.IsNew {
err = db.DbMap.Insert(&s)
} else {
_, err = db.DbMap.Update(&s)
_, err = db.DbMap.Exec("update http_sessions set data=$1, modifiedon=$2, expireson=$3 where key=$4", s.Data, s.ModifiedOn, s.ExpiresOn, s.Key)
}
return err