Sessionnotfound

I am creating a simple .net Maui application that after about 20 minutes of idle time gets a sessionnotfound error when I attempt to make a call to the server. I have wired up the OnLoginNeeded event to log in again but how can I keep the original call from failing in the first place.

Thanks for your help

Daniel

Hi,

if you want to keep session on server, you can call empty custom method every 10 min.
SessionNotFoundException is a special kind of exception that is handled by Remoting SDK code.

Check Authentication and Login article for more details

This is really “as designed”. In order to not have to worry about session timeouts (which are essential, however log you set them), RO SDK is programmed to catch the NoSessionFound exception automatically, try your login (transparently to your applications; main flow) and resubmit the original call.

This should really only be an issue, and I’d only suggest worrying about it, if you are sending large requests and want to to avoid potentially having to resend a lot of data.

Potential workarounds are

a) extend the session limit on the server (id recommend against that, as you’re just showing the “problem” further into the future, and eventually, the session will time out (or your server will restart, or whatever).

b) have a regular “ping” message to the server, at intervals shorter than the session timeout, in order to extend the session regularly (no huge downsides, aside from that it seems like unnecessary traffic.

c) explicitly call Login() before sending an (again, potentially large) request you do not want to fail.

but best, really

d) don’t worry about it, and consider this “as designed” (and maybe add the SessionNotFound exception to your set of ignored exceptions in the debugger, if that’s what bothers you).

Very helpful! Thanks Marc.

1 Like