Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Single Session Laravel Package

pbmedia/laravel-single-session

pbmedia/laravel-single-session limits each user to one active session at a time, automatically invalidating older sessions when a new login occurs. Simple to install and configure, it helps secure Laravel apps against shared or forgotten sessions.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Seat-based licensing and account-sharing enforcement. If pricing is per-seat, "one login at a time" is the cheapest technical lever against credential sharing. A single-session rule converts a soft policy into an enforced product constraint — directly protecting revenue per account.
  • Concurrent-session limits as a plan differentiator. Enables tiering: single-device on Starter, N-devices or "unlimited" on Pro/Enterprise. This is a packaging decision the package makes cheap to ship first.
  • Security posture for RFPs and questionnaires. "Do you enforce one active session per user?" and "are sessions revoked on password change?" show up in security reviews and SOC 2 / ISO evidence packs. This is a checkbox item, not a differentiator.
  • Session invalidation on lifecycle events. Log out existing sessions on password reset, role change, admin-initiated deactivation, or offboarding. Reduces the window where a stale session retains access after permissions are revoked.
  • Build vs. buy: build. The package is ~100 lines of login-event listener. It is archived (last release 2018-06-25), has zero dependents, and 102 stars. Treat it as a reference implementation to copy, not a dependency to adopt.
  • Framework overlap check. Laravel ships Illuminate\Session\Middleware\AuthenticateSession and Auth::logoutOtherDevices(), which cover most of this natively. A roadmap item here may already be a config toggle — validate before scheduling work.

When to Consider This Package

Consider it (as a pattern to borrow) when:

  • The app is legacy Laravel 5.x and pinned there; the 2018 code will run and the effort to port is not worth it.
  • You need a fast prototype or internal tool where maintenance burden is near zero and the user base is trusted.
  • Scope is genuinely simple: single guard, standard session driver, no SPA/token auth, no multi-tenant session isolation.
  • You want a readable reference for how log-in events, session IDs, and remember-tokens interact before writing your own listener.

Look elsewhere — or write your own — when:

  • You are on Laravel 8+. Session handling, guards, and Sanctum/Passport have moved; an unmaintained 2018 package is a security-patch liability with no upgrade path.
  • Your clients are API/token-based. Killing a session does not revoke an issued bearer token; this addresses cookies, not tokens. Different mechanism, different design.
  • You need "remember me" handled correctly. Destroying the session does not invalidate the persistent remember cookie; the token must be cycled or the user silently re-authenticates. This is the most common functional bug in homegrown versions of this feature.
  • You need auditability — session history, device listing, "you were signed out because…" notifications, or admin visibility. The package does none of this.
  • You need limits greater than one (e.g., "up to 3 devices") or per-device naming. Out of scope.
  • Procurement requires a maintained dependency with a release cadence, changelog, and vendor responsiveness for your vendor-risk review.

How to Pitch It (Stakeholders)

To executives: This addresses a real commercial problem — customers sharing logins to avoid paying for seats — with an approximately one-day engineering effort. The important nuance is that we should not adopt the package. It was last released in 2018, is formally archived, and has no downstream users; it cannot be patched. The underlying idea, however, is small, well-understood, and already partially available in Laravel itself. Recommendation: reproduce the behavior in-house, or enable the framework's built-in session-invalidation middleware, and own the code.

To engineering: Treat this as a spec, not a dependency. The pattern is: on successful login, invalidate all other sessions for that user; additionally, invalidate on password change and privilege change. The two details to get right are (1) the remember-me token, which survives session deletion and must be cycled, and (2) UX — the displaced user should be told why they were signed out, not silently dropped. The package's session-ID approach is fine as a starting point but predates current Laravel conventions.

Bottom line: High product value, near-zero value as a purchase. Buy the idea, build the code in under a week, and skip the archived dependency entirely. The open question for the roadmap is whether single-session is a default policy or a plan-gated one — that is a pricing decision, not a technical one, and should be settled before engineering starts.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource