How to get a Session reference from within a WebView code executing in the main thread?

Hi guys,

I’m using two push notification systems in a web app. The first one is Application wide, and the other one is Session wide.
Notifications are pushed by a timer, which means that the code is executed inside the main thread where the Session object is unavailable.
Some times, code triggered by a notification needs to access some of the Session custom properties liker user ID, username or some access privilege flags. In the session wide system, a Session reference is attached to the notification, everything is fine. But in the application wide system, attaching a Session reference doesn’t make sense in this case.

Given that the code, while being executed in the main thread, has access the Webview it’s manipulating ( i.e. Self is meaningful ), is there a way to easily retrieve a reference to the Session this Webview is pertaining?
I already have another way to workaround this, but it is heavier to handle than simply retrieving a property or calling a method.

Perhaps WebApplication.SessionForControl.

Sounds nice! :slight_smile:
I’ll give it a try tonight. Thank you Frederick.