Store session data in database.