Store session in database.