How do you determine if a session is 'disconnected' with REST API?

In the REST API, there is a function called show-session that gives the details for a specific session uid. What parameter (or what logic is used) to determine if the session is 'disconnected' as seen in SmartConsole:

I originally thought it would be 'connection-mode', however, when I query the 'Disconnected' sessions, the connection-mode is 'read write'.

Re: How do you determine if a session is 'disconnected' with REST API?

In my attempt last week to solve this, I tried expired-session as i thought that might be it, so I wrote code that checks first if session-expired is 'False'. If 'False', I then check if either string 'write' or 'lock' exists in 'connection-mode'.

However, I've found one instance where expired-session is set to 'False', yet the session still shows as disconnected in SmartConsole. It seems to have been logged out for a couple months. Is this a bug?

Here is the json for the session object in question. It corresponds to the top line in the picture from SmartConsole in the main post above. I've removed the content of some fields and replaced them with <removed>.