Added session logic to application.