Telnet logout option
Extracted elements (12)
A secondary usage of the LOGOUT option is for a server to warn a user of an impending auto-logout due to inactivity by sending IAC WILL LOGOUT, allowing the user to respond with DON'T LOGOUT to continue the session.
The option exists because runaway or hung user processes cannot always be interrupted by normal means, and many hosts 'detach' rather than log out a process on connection close to protect against accidental disconnects. This leaves hung jobs loading the system when the user has given up completely.
A user may send IAC DO LOGOUT and then immediately close the connection without waiting for confirmation; at worst the server ignores the request and detaches the process, but a conforming server should still honor the logout.
The auto-logout warning mechanism cannot be gamed indefinitely: a server is not prevented from logging out the user process if inactivity continues even after the user repeatedly sends DON'T LOGOUT in response to WILL LOGOUT warnings.
A server that implements the LOGOUT option should log out the user process despite a sudden connection close and even an inability to confirm the LOGOUT request.
The default state is WON'T LOGOUT and DON'T LOGOUT, meaning no forcible logging off of the server's user process occurs unless the option is negotiated.
Upon receiving IAC DO LOGOUT, a server may respond with IAC WILL LOGOUT and then forcibly log off the user process; it need not wait for the user to receive confirmation before starting the logout.
IAC DO LOGOUT: the sender requests that the receiver forcibly log off the user process at the receiver's end, or confirms that the receiver has permission to do so.
IAC DON'T LOGOUT: the sender demands that the receiver not forcibly log off the user process at the receiver's end.
IAC WILL LOGOUT: the sender requests permission to, or confirms that it will, forcibly log off the user process at its end.
IAC WON'T LOGOUT: the sender refuses to forcibly log off the user process at its end.
The LOGOUT Telnet option is assigned code 18. It allows a user process to request that the server forcibly log off the user process rather than merely detaching it.