timers and sessions and FileDownloaded

why is the SESSION not available in a timer Fired event or the FileDownloaded event?

I.e. dim s as string = session.abc

session = nil and a crash

making a program to add a line at the top and bottom of everything to track down a particularly annoying bug.
finding everywhere a session isn’t available and I can justify them all except for these two.

Is it BUG worthy?
HAPPY new YEAR - started feeling human about 3 hours ago.

thanks Damon

[quote=238795:@damon pillinger]why is the SESSION not available in a timer Fired event or the FileDownloaded event?

I.e. dim s as string = session.abc

session = nil and a crash

making a program to add a line at the top and bottom of everything to track down a particularly annoying bug.
finding everywhere a session isn’t available and I can justify them all except for these two.

Is it BUG worthy?
HAPPY new YEAR - started feeling human about 3 hours ago.

thanks Damon[/quote]

A timer always fires in the main thread. AFAIK same thing for a WebFile event. So, just like in handleURL and other such events, Session is not available.

The solution is to use http://documentation.xojo.com/index.php/WebSessionContext to bring in the appropriate session.

You can also use a WebTimer instead. As it is part of a webpage, it does provide Session access.

thanks Mic