romshark / webwire-go

A transport independent asynchronous duplex messaging library for Go
MIT License
216 stars 9 forks source link

Multi-Connection Session #4

Closed xrei closed 6 years ago

xrei commented 6 years ago

Problem

Currently a session can only be assigned to a single connection, though sessions should accept multiple simultaneous connections to support authentication across multiple browser tabs/windows of the same domain.

Proposed Solution

Ease this restriction by adding an option for the maximum number of simultaneous connections associatable with a single session.

romshark commented 6 years ago

Added support for multi-connection sessions in #144c6ad.

The server now provides a new option: MaxSessionConnections which defines the maximum number of simultaneous connections a single session will accept. Session restoration requests exceeding the limit will fail. If the option is set to zero, which it is by default, then the limit is lifted.