Session Timeout

Hi,

I created a dashboard (version 2.4 / licensed) which is running on an IIS. There are UDAuthorizationPolicies as well. Everything works fine and I’m happy so far but there is one thing that bugs me and I hope there is a simple solution to it. When I haven’t used the dashboard for like 20-30 minutes and I start using it without refreshing the page (e.g. pressing F5, reopen the dashboard) error messages pop up in the lower right corner. pretty much every functionality is build on an SQL queries or on WMI actions. I get messages like:

‘you cannot call a method on a null-valued expression’

or

‘method invocation failed because [System.DBNull] …’

but the dashboard still works even though I’m getting these messages. When I press F5 and do the same action again, everything works fine without getting these error messages.

So, is there a way to keep the session alive or is it possible to query the timeout and popup a Toast message in order to get people refreshing their page? Any help is appreciated.

Thanks

make sure that the app pool dont idle out, it do this default after 20 min, so IIS will terminate the app pool.
see the idle timeout section:
https://weblogs.asp.net/owscott/why-is-the-iis-default-app-pool-recycle-set-to-1740-minutes

thanks, I’m testing it right now. Will keep you updated about the result in about 30 minutes :slight_smile:

unfortunately it didn’t work. I’ve set the application ‘Idle Time-out (minutes)’ to zero, recycled the application pool, restarted the page and I still get error messages.

one of my pages is kind of a monitoring page and there are several buttons which start sql queries and show the result temporarily in a modal window.

I get the error message:

‘Cannot send data if the connection is not in the ‘Connected’ State’

one refresh, everything works as intended.

@adam Hey Adam, do you have an advice for me?

Hi @H4nYolo,

It looks like the websocket is disconnecting for some reason. Can you look in the developer tools for your browser for any weird errors? If you press F12 it should open those up.

Hi @adam

seems like you pointed me in the right direction.

this is what I get after a while using the company standard IE:

when I do the same with Firefox ESR I have no problems at all means I need to figure out what they changed by policy to make IE fail after like 20 minutes.

IE11 dont support Websockets :slight_smile:

so dont use that.

Hey @McAndersDK do you have a source for this statement? When you google for IE 11 websocket support pretty every source is telling me its supported. :thinking:

@H4nYolo are you using the -AutoRefresh and -RefreshInterval parameters on your new-udpage to prevent it from timing out? Just my 2 pence worth…just was thinking if F5 sorts the problem its like your page has become stale and needs refreshing every now and then to keep the connection active. So if your not using the auto refresh parameters then I would give that a shot to see if that solves the problem.

I’ve also been looking for a way to indicate to users that their connection is no longer active. We have a number of staff that actively use a dashboard, and if, for example, they undock their laptop or an admin restarts IIS to apply a change, their connection stops.

To help with this I put a clock at the top of every page with a 1 second refresh and let the staff know that if the clock is not running, they’re disconnected and should refresh the page before trying to do anything. It’s certainly not a great solution though.

@psDevUK hey, yes, but nothing helps. it times out in IE but not in firefox.

@daver107 have you tried firefox? i have no problems with firefox ESR but its not company standard. a solution for IE would be awesome. I’m kinda glad I’m not the only one having this problem :stuck_out_tongue_winking_eye:

@adam I tried it on a vanilla windows server 2019 without custom policies and I get the same warnings and errors. there is a -IdleTimeout switch on the new-uddashboard command but it’s not documented so far. could this be a solution?

@adam
Am using the dashboard with dbatools to restore DBs i have tested some db restore today which kind of little bit big and i found that after some time of doing the restore checking my browser F12 the following error was there
failed to load resource the server responded with a status of 504 at fetch.service

so it looks like my session was timed out, how ca we solve such a thing, am hosting in IIS windows server 2019.

i mean for small db restore its not an issue maybe because am still below 25 min but for big db restore how can we increase the timeout ?

Tank you

Are you setting the IdleTimeout on New-UDDashboard? You should be able to increase that.

There might be an IIS setting you need to set as well.

Is there a way to monitor the IdleTimeout? Like, how much is left? Maybe with a scheduled task?
I set the idle timeout on my IIS application pool to 43200 minutes (the max), and the IdleTimeout on the Start-uddashboard to various times and it works well that way. I just want to do some kind of pop up when the IdleTimeout is approaching the limit to let people know they have to reload or to somehow programmatically do it.

Thanks!

@eefisherv
quick question. when you open the developer tools and open the console tab, there are no: “Warning: Timeout from HTTP request.” messages after like 5 minutes? I get these no matter what I do in IE.

I generally use Chrome… had to find IE11 on my machine… I just let my dashboard go for 10 minutes, and did not see that message popup in the console.

V.

@eefisherv

Just wanted to test it on my vmware Server 2019 and now I get this :slight_smile:

chrome works, IE refuses to load the site. I already googled the error and checked all the settings and it seems like, the default settings should be fine … it’s never getting boring :smiley:

Make sure your IE settings for TLS are set.

image

well, didn’t change anything. Vanilla MS Server 2019.