Change session method to database