2021r3 WebSessionContext constructor returning Unhandled Session Error

In Xojo 2021r3, I’m trying to create a WebSessionContext in app however I’m having an Unhandled Session Error returned with the message:

WebSessionContexts cannot be created within a running session.

I am creating it as per the documentation and how it has worked in previous versions of Xojo:

Dim context As WebSessionContext
context = New WebSessionContext(Session.Identifier)

I noticed that in the r3 release notes that this was added:

Creating a WebSessionContext when another session has precedence will now fail consistently with an UnsupportedOperationException.

How am I meant to jump through sessions from a method in-app if the method that called it is in a session? I can create a WebSessionContext if it’s the session I’m calling it from but not any others.
Methods from app and modules are now connected to a session when called from it when they should be separate?

Have a look at this conversation.

Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.