mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 14:30:56 +00:00
Update SessionExist to close the db connection
close the mysql connection
This commit is contained in:
parent
63f19974cd
commit
dc767b65df
@ -115,6 +115,7 @@ func (mp *MysqlProvider) SessionRead(sid string) (SessionStore, error) {
|
|||||||
|
|
||||||
func (mp *MysqlProvider) SessionExist(sid string) bool {
|
func (mp *MysqlProvider) SessionExist(sid string) bool {
|
||||||
c := mp.connectInit()
|
c := mp.connectInit()
|
||||||
|
defer c.Close()
|
||||||
row := c.QueryRow("select session_data from session where session_key=?", sid)
|
row := c.QueryRow("select session_data from session where session_key=?", sid)
|
||||||
var sessiondata []byte
|
var sessiondata []byte
|
||||||
err := row.Scan(&sessiondata)
|
err := row.Scan(&sessiondata)
|
||||||
|
Loading…
Reference in New Issue
Block a user