cjmellor/browser-sessions
Track and manage user browser sessions in Laravel. See devices, browsers, IP addresses, and last activity, then log out other sessions with a ready-made Blade/Livewire component built on Laravel's database session driver.
Package purpose and architecture fit. cjmellor/browser-sessions is a standalone Laravel package that adds "manage active browser sessions" capability (device/session listing and remote logout) to an application — functionality historically available only by adopting Jetstream/Fortify's built-in implementation. Architecturally it slots in as a thin layer over Laravel's SessionGuard and the sessions database table: a trait on the User model, a published migration/table for browser-session metadata (device, platform, browser, IP, last activity), a service provider, and config for guard/model wiring. This is a good fit for any Laravel app using session-based auth with the database session driver and a conventional users provider; it is a poor fit for token-only APIs (Sanctum personal access tokens, Passport) or stateless SPA auth, since there is no session row to enumerate.
Integration feasibility. Integration is low-ceremony and typical of the ecosystem: composer require, publish config/migrations, add the trait to the User model, register the guard/model in config, run migrations, and optionally expose routes/controllers or build your own UI against the provided query surface. The work is mostly configuration and UI, not code surgery — realistically a few days for a first working slice in a mid-sized app.
Technical risk. The dominant risk in v2.0.0 is version pinning, not behavior. This is a semver-major release whose only substantive change is support-matrix movement:
laravel-pint-action, git-auto-commit-action, dependabot/fetch-metadata bumps) — no runtime code changes are described.So the practical risk profile is: (1) if you are on Laravel 10 or 11, composer update will not take v2.0.0 — you stay on the 1.3.x line, which is now a maintenance branch with no stated support window; (2) if you are on Laravel 12, verify the constraint actually admits 12 before upgrading (a release that adds 13 and drops 10/11 should keep 12, but the changelog doesn't state it explicitly — confirm in composer.json); (3) no breaking API changes are signaled, so upgrading from 1.3.2 on a supported framework should be a low-drama composer update plus regression of the sessions UI.
Secondary, standing risks (unchanged by this release, but material to a TPM decision): tight coupling to Laravel's session internals means a framework session-layer change can break the package between majors; the package writes/reads a metadata table whose growth is unbounded without pruning; and IP/device data is personal data with GDPR/CCPA implications that need a retention policy.
Key questions for the maintainer/team.
composer.json in v2.0.0 still permit Laravel 12, or is 12 also dropped? What is the minimum PHP version?src/ and config/.SessionGuard only, or is there a path for multi-guard apps?Stack fit. Assume a Laravel app on a session-based guard, database (or redis-with-enumeration) session driver, and Blade/Inertia/Livewire front end. The package is a natural fit there and largely redundant if the team already runs Jetstream with its profile session panel — in that case adopt only if you want the feature decoupled from Jetstream. Do not adopt for an API-only service.
Migration path (v1.3.2 → v2.0.0).
^1.3 and schedule a framework upgrade. Laravel 12 → verify the 2.0.0 constraint admits it, then treat as a patch-level upgrade. Laravel 13 → required.composer require cjmellor/browser-sessions:^2.0 in a branch; review the lockfile diff to confirm only this package (and not transitive framework packages) moved.config/browser-sessions.php and the migration against your committed copies; re-publish only if the package's stubs changed. Check for any new required config keys.composer.lock; no DB rollback should be needed if migrations are unchanged.Compatibility and sequencing. Do this as an isolated dependency PR, not bundled with feature work. Sequence: framework version check → dependency bump → config diff → functional regression of session listing/revocation → deploy behind the existing UI (no user-facing change expected). If you are mid-framework-upgrade to 12 or 13, land the framework upgrade first, then this bump, so a failure is attributable to one change.
Adoption sequencing for a first-time install. Ship read-only session listing first (low risk, high user value), then enable remote revoke once you've validated that revocation propagates correctly across your session driver and any load-balanced/multi-node setup. Confirm cache/session backend supports cross-node invalidation before exposing revoke as a one-click action.
Maintenance. Ongoing cost is low but not zero: this package tracks Laravel majors, so expect a required bump roughly annually tied to framework releases — and that bump will be a major whenever the support matrix moves, even with no API change. Budget a small dependency-upgrade task per Laravel major. The 2.0.0 changelog shows a healthy automation posture (Dependabot + auto-commit + Pint), which is a positive maintenance signal, though it also means most releases are CI noise and the substantive ones are rare — read the diff, not the title.
Support. Maintained by a single author (cjmellor) with community PRs. Bus factor is the main structural concern: one maintainer, no stated security policy or LTS commitment. Mitigation: the package is small and self-contained — fork-and-own is genuinely viable if it goes stale, and the underlying mechanic (querying the sessions table via SessionGuard) is well-trodden Laravel territory. Keep the published config and migration in-repo (not gitignored) so a fork requires no archaeology.
Scaling. Session listing queries the sessions table by user_id — this needs an index on user_id (Laravel's default sessions migration provides one in recent skeletons; verify). At high user counts the per-user row set stays small (one row per active session), so read cost is negligible. The bigger scaling concerns are: (a) writes on every request if the package persists device metadata beyond Laravel's own session update — check whether it hooks into each request or only on login; (b) multi-node deployments require a shared session store (database/redis) for revocation to be visible everywhere; (c) table growth if sessions are never pruned — Laravel's session:prune/sessions garbage collection handles the core table, but confirm any package-owned metadata table is covered by the same pruning.
Failure modes.
src/ diff rather than trusting release notes.Ramp-up. Very low for any Laravel-fluent engineer: the package follows framework conventions, and the mental model (it reads the sessions table and lets users delete rows) is comprehensible in under a day. The only non-obvious areas are guard configuration and multi-node session invalidation semantics. Document the retention policy and the "which guards are supported" answer alongside the integration so future maintainers don't re-derive it.
Recommendation. Treat v2.0.0 as a compatibility-triggered bump, not a feature upgrade. Adopt immediately if you are on Laravel 13; adopt after a constraint check if on 12; stay pinned to ^1.3 and treat the framework upgrade as a prerequisite if on 10/11. No functional benefit accrues from 2.0.0 itself, so there is no urgency beyond staying on a supported branch.
How can I help you explore Laravel packages today?