Update SessionExist to close the db connection

close the mysql connection
Merge pull request #463 from NormanZhang/develop

Update SessionExist to close the db connection