invoking retrieveCookie(NamespacedKey) with the same namespace twice deletes the first retrive from the map, resulting in kicks
Author: OutfluencerCreated Aug 24, 2026Updated Sep 28, 2026
Labelsstatus: accepted
Expected behavior
When calling retrieveCookie(NamespacedKey) twice, both futures should be completed and the client should not be kicked.
Currently
@Override
public void handleCookieResponse(ServerboundCookieResponsePacket packet) {
if (this.paperConnection().handleCookieResponse(packet)) return; // Paper
this.disconnect(DISCONNECT_UNEXPECTED_QUERY, io.papermc.paper.connection.DisconnectionReason.INVALID_COOKIE); // Paper - kick event cause
}kicks the player.
Because the second retrieveCookie call overrides the first because its a map, then when both cookies arrive the last one is not handled https://github.com/PaperMC/Paper/blob/37dc5450d9b7acb2e367e8f1fbe0f07bb01334d9/paper-server/src/main/java/io/papermc/paper/connection/ReadablePlayerCookieConnectionImpl.java#L19
Observed/Actual behavior
Kick for Component.translatable("multiplayer.disconnect.unexpected_query_response")
Steps/models to reproduce
retriving the same cookie twice directly
Plugin and Datapack List
Paper version
latest
Other
No response
Source: PaperMC/Paper