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

overtrue/laravel-single-session

Prevent concurrent logins in Laravel by limiting each user to a single active session. When a user signs in from a new device or browser, earlier sessions are invalidated automatically, keeping accounts secure with minimal setup.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. The package is a thin Laravel service provider plus middleware that hooks into the native Auth/session lifecycle to keep one active session per user. That shape is architecturally compatible with Laravel’s guard/session abstractions, but it targets the Laravel 5.5–5.6 era (last release December 2017). On any modern Laravel (8.x–12.x) the overlapping native primitives — Illuminate\Session\Middleware\AuthenticateSession, Auth::logoutOtherDevices(), and the password_hash column — already cover most of the stated value proposition, so the package is largely redundant where it still works and broken where it would be needed.

Integration feasibility. Public signals are weak: 17 stars, a composite score of 0.1375, archived repository, no release since 2017. Expect Composer constraints against illuminate/support/illuminate/session in the ^5.5 range, PHP ^7.0-era requirements, and no CI/test evidence. Installing on a current Laravel app will likely fail dependency resolution or require --ignore-platform-reqs and constraint overrides — a maintenance liability before a single line of integration code is written.

Technical risk.

  • Abandoned: no security patching, no CVE response, no compatibility fixes.
  • Single-maintainer, low-adoption code: effectively unaudited third-party code inside the authentication path.
  • Laravel changed session ID handling (hashing, cookie encryption, AuthenticateSession semantics) after 5.6; the package’s invalidation strategy may silently no-op rather than fail loudly.
  • "No extra database tables" implies its session-tracking state lives in cache or the user record; correctness then depends on cache driver, TTLs, and eviction behavior, which the description does not specify.

Key questions.

  • Which Laravel and PHP versions are actually in the estate, and is any app still on 5.5/5.6?
  • Which session driver(s) are in use — file, database, Redis, cookie?
  • Does invalidation depend on deleting rows in the sessions table (driver-specific) or on a cache key?
  • Is the requirement "one session per user" or "log out other devices on password change"? The native middleware only does the latter.
  • Do we need user notification/audit on concurrent login, which the package does not provide?
  • What is the actual threat model — credential sharing, session theft, compliance?

Recommendation: do not adopt. Replace with native Laravel primitives or a small in-house listener.

Integration Approach

Stack fit. Fits only a legacy Laravel ≤5.6 application using a shared session backend. On a modern stack it is a net-negative: redundant behavior, dependency conflicts, and an unmaintained package in the auth path. Score and archive status alone disqualify it for anything security-sensitive.

Migration path (replacement, not adoption).

  1. Enable AuthenticateSession middleware on authenticated route groups; add the password_hash column (or an equivalent custom guard) so password changes invalidate other sessions.
  2. On login, call Auth::logoutOtherDevices($password) where the UX calls for "sign out everywhere else," or implement a ~40-line Login event listener that stores the current session ID per user in Redis/DB and invalidates prior IDs.
  3. If route-level enforcement is needed, register the middleware per group exactly as the package advertised — the native path supports this.
  4. Decommission the package; do not vendor or fork it unless a legacy app cannot be upgraded, in which case pin the fork internally and schedule its removal with the framework upgrade.

Compatibility. Validate against the actual session driver matrix. File-driver sessions on multi-node deployments cannot be reliably invalidated from another node without shared storage; Redis/database drivers are required for deterministic behavior. Confirm the replacement works with "remember me" tokens, API guards (Sanctum), and any custom guards before rollout.

Sequencing. (1) Inventory apps and Laravel versions; (2) confirm requirement with security/product — single-session vs. logout-other-devices vs. concurrent-login alerting; (3) prototype native approach in staging against the real session driver; (4) roll out behind a feature flag with login-failure dashboards; (5) remove any package references and update the dependency policy to block archived packages in auth-critical paths.

Operational Impact

Maintenance. An archived package is a permanent maintenance tax: every Laravel/PHP upgrade becomes a manual compatibility investigation, and any fork we create becomes our code to own, test, and patch. Native primitives are maintained by the framework and covered by Laravel’s release/security process.

Support. No upstream support, no issue triage, no security contact. Internal on-call would own any auth incident traced to the package with no escalation path — unacceptable for a component whose failure mode is "users cannot log in" or "old sessions stay valid."

Scaling. Correctness depends on a shared, low-latency store for the per-user session pointer and on consistent session storage across nodes. Horizontal scaling with file-based sessions will produce non-deterministic invalidation. Cache eviction or TTL expiry can either leave stale sessions authenticated (security gap) or lock out the legitimate user (availability gap), with no telemetry from the package to distinguish the two.

Failure modes.

  • Lockout loops when the tracked session ID and the cookie disagree (e.g., after deploy, cache flush, or session regeneration).
  • Race condition on simultaneous logins from two devices — last-writer-wins can invalidate the session that just authenticated.
  • Remember-me cookies re-authenticating a session that was supposed to be killed.
  • Silent no-op on unsupported Laravel/session-driver combinations, giving false assurance of enforcement.
  • Cache outage taking down login entirely rather than degrading to multi-session.

Ramp-up. The codebase is small and a mid-level engineer can replicate its behavior natively in one to two days, including tests. Ramp-up on the package itself is low but yields knowledge of an unsupported artifact; that effort is better spent on the native replacement, which also produces code the team can maintain.

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.
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel
draftsmaninc/draftsman
square-bit/laravel-volition
himito/laravel-mailman
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast