Add logic to handle sessions