Update SessionExist to close the db connection
close the mysql connection
Showing
1 changed file
with
1 additions
and
0 deletions
| ... | @@ -115,6 +115,7 @@ func (mp *MysqlProvider) SessionRead(sid string) (SessionStore, error) { | ... | @@ -115,6 +115,7 @@ func (mp *MysqlProvider) SessionRead(sid string) (SessionStore, error) { |
| 115 | 115 | ||
| 116 | func (mp *MysqlProvider) SessionExist(sid string) bool { | 116 | func (mp *MysqlProvider) SessionExist(sid string) bool { |
| 117 | c := mp.connectInit() | 117 | c := mp.connectInit() |
| 118 | defer c.Close() | ||
| 118 | row := c.QueryRow("select session_data from session where session_key=?", sid) | 119 | row := c.QueryRow("select session_data from session where session_key=?", sid) |
| 119 | var sessiondata []byte | 120 | var sessiondata []byte |
| 120 | err := row.Scan(&sessiondata) | 121 | err := row.Scan(&sessiondata) | ... | ... |
-
Please register or sign in to post a comment