Sometimes you’re working on a server remotely and the ssh connection gets interrupted. Usually when that happens, ssh will stall until the socket times out and you’re stuck with an unresponsive terminal. To get back to the terminal from your stalled ssh session, use this key sequence:
<enter>
<enter>
<enter>
<shift-tilde>
<period>

Does this close the SSH session on the remote server, or just “disconnect” it from your local terminal? Is this for Terminal.app on Mac, or does it work in gnome-terminal, putty or other terminal emulators too?
It’s a client-side disconnect for the ssh command line client, rather than server side (eg. when you type “exit” on the server). It’s independent of your terminal software. Bear in mind that Putty does not use the ssh command line client, it is its own ssh client.