skip to content

After a network drop, an RDP client returns to its locked session with no credential prompt: what replaced the credentials, and what do events 4779 and 4778 show?

level: seniorimportance: should knowfreq 17%

answer

  1. a token the server issued after logon
  2. bound to the session, refreshed hourly
  3. the lock screen is not a boundary
  4. one event leaving, one event returning

basics

~20 s

After logon the server gives the client an auto-reconnect cookie bound to the session. After a network failure the client sends a modified copy instead of credentials. Events 4779 and 4778 record the disconnect and the return.

solid answer

~40 s

After a successful logon, the server sends an **auto-reconnect cookie** in the Save Session Info PDU, bound to that user's session. When the network drops, the client reconnects and sends a cryptographically modified version of the cookie in the Client Info PDU, and the server uses it to confirm that this is the last client that was connected to the session. The server regenerates the cookie whenever a client connects or the session is reset, and refreshes it hourly. Microsoft notes that automatic reconnection is on by default and that a locked session reconnects without re-authentication, so the lock screen is not a security boundary. Event 4779 records the disconnect and 4778 the return, each with account, Logon ID, session name, client name and client address.

code

plaintext · 15 lines
plaintext
4779 A session was disconnected from a Window Station
  Account Name:   a.user
  Account Domain: CORP
  Logon ID:       0x1e01f6
  Session Name:   RDP-Tcp#3
  Client Name:    WS0417
  Client Address: 192.0.2.40

4778 A session was reconnected to a Window Station
  Account Name:   a.user
  Account Domain: CORP
  Logon ID:       0x1e01f6
  Session Name:   RDP-Tcp#6
  Client Name:    WS0417
  Client Address: 192.0.2.40

go deeper

for a junior

Know that RDP can reconnect after a network drop without asking for the password again.

for a middle

Describe the cookie from Save Session Info to Client Info, and why it is regenerated per connecting client and refreshed hourly.

for a senior

Read 4779 and 4778 with their limits, and choose between disconnect on lock and turning automatic reconnection off, knowing which applies to new sessions only.

for a principal

Weigh the usability of seamless reconnection against a lock screen that is not a boundary, population by population.

## What replaced the credentials MS-RDPBCGR section 1.3.1.5 describes **automatic reconnection**, which lets a client reconnect to an existing session after a short-term network failure without resending the user's credentials. 1. After a successful logon the server sends the client an auto-reconnect cookie in the Save Session Info PDU. The cookie is bound to the user's current session and the client stores it. 2. If the connection drops because of a network error, the client tries to reconnect. 3. In the Client Info PDU of the secure settings exchange it sends a cryptographically modified version of the cookie. 4. The server uses that to confirm that the requesting client is the last client that was connected to the session. If the check passes, the client is connected to the session when the connection sequence completes. ## How the server limits the cookie The cookie is not long-lived and not shared between clients. - It is **flushed and regenerated whenever a client connects** to the session or the session is reset, so a different client connecting means earlier clients can no longer use automatic reconnection. - The server **invalidates and updates it at hourly intervals**, delivering the new one in the Save Session Info PDU. This is a convenience for flaky links on a single host. Reconnecting a user to a session anywhere in a farm is a broker function and is covered separately. ## The security consequence Microsoft's Remote Desktop Services documentation states that automatic reconnection is enabled by default, and that when a policy or the user locks the remote session and the connection is disrupted, the session state and connection information are retained, so the client reconnects **without needing to reauthenticate**. It says the lock screen of the session is not designed to function as a security boundary and recommends extra measures where that is a concern. You have two kinds of control: - **Disconnect on lock.** The policy `DisconnectOnLockLegacyAuthn` (registry value `fDisconnectOnLockLegacy`, under Remote Desktop Session Host security) makes a locked session disconnect rather than sit on the lock screen, so it cannot reconnect automatically after a network loss; the user re-enters credentials. It applies to the legacy authentication protocols the page lists (NTLM, CredSSP, RDSTLS, TLS and RDP basic) and only on the builds the page lists. A separate setting covers the other authentication kind. - **Turn automatic reconnection off.** On the host through the Group Policy setting *Automatic reconnection*, the session collection property, or the PowerShell command `Set-RDSessionCollectionConfiguration` with `-AutomaticReconnectionEnabled $false`; on the client with the RDP property `autoreconnection enabled:i:0`. Rules from the documentation: disabling on the server wins regardless of client configuration; changes apply only to new sessions; and a collection setting works only if Group Policy is Not Configured on each host, because the Group Policy setting takes priority. ## Reading events 4779 and 4778 Both are in the Audit Other Logon/Logoff Events subcategory. | Field | Meaning | |---|---| | Account Name, Account Domain | Who was disconnected or reconnected | | Logon ID | A hexadecimal value for correlation with other events such as 4624 | | Session Name | For example `RDP-Tcp#3`; `Console` for Fast User Switching | | Client Name, Client Address | The machine and IP address the user connected from | In Microsoft's own sample, the 4779 and 4778 share one Logon ID while the Session Name differs, which is why the Logon ID is the field to join on. **What the events cannot prove.** The documented fields do not say whether the reconnect was automatic or manual, how the user authenticated, or whether anything was copied. They are also generated for Fast User Switching and the enhanced-session console of a virtual host, so filter on a Session Name containing `RDP-Tcp`. The monitoring recommendations on the pages suggest watching high-value accounts and checking that Client Address falls in your internal list. ## Scope and rollout This is single-host behaviour: the cookie ties a client to a session on one host, and a farm adds a broker that decides which host receives a returning user, which is a separate topic. Because changes apply only to new sessions, a policy change is not in effect for sessions already open; plan for them to end before you report the control as in place. ## Common mistakes - Treating the cookie as a stored password. - Believing the lock screen forces re-authentication after a network drop. - Reading 4778 as a new logon: it is a return to an existing session. - Expecting a server-side change to affect sessions already open.

  • Why does the server regenerate the auto-reconnect cookie every time a client connects to the session?
    So that only the most recent client can reconnect automatically. MS-RDPBCGR says the cookie is flushed and regenerated whenever a client connects or the session is reset, which means any previous client can no longer use automatic reconnection. The server also invalidates and refreshes it hourly, sending the new value in the Save Session Info PDU.
  • A host's Group Policy disables automatic reconnection, but a user's saved RDP file still enables it. Which wins?
    The host. Microsoft's documentation says that disabling automatic reconnection on the server means clients cannot perform it regardless of their configuration. It also notes that changes apply only to new sessions, so sessions already open keep the setting they had when they connected.

  • Says the client stores the password to reconnect automatically
  • Believes the lock screen forces re-authentication after a drop
  • Thinks a server policy change reaches sessions already open
  • Reads event 4778 as a fresh logon
  • Says the same cookie works for any client indefinitely