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
Browser Sessions

Browser Sessions Laravel Package

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.

View on GitHub
Deep Wiki
Context7

A Laravel package to enable users to manage and monitor their active browser sessions. Allows users to view devices where they are logged in and provides options to terminate unrecognized or all sessions, enhancing account security

Frequently asked questions about Browser Sessions
How do I install and set up cjmellor/browser-sessions in a Laravel app?
Install it with composer require cjmellor/browser-sessions, then publish the package config and migrations, run php artisan migrate, and add the provided trait to your User model. You also register the guard and model wiring in the package config file. Setup is mostly configuration plus optional routes or UI, not code surgery.
Which Laravel versions does browser-sessions v2 support?
Version 2.0.0 adds Laravel 13 support and drops Laravel 10 and 11, both of which are now end-of-life. Laravel 12 should still be admitted, but the changelog does not state it explicitly, so confirm the constraint in composer.json before upgrading. If you are on Laravel 10 or 11, stay on the 1.3.x line.
Does cjmellor/browser-sessions work with Sanctum or an API-only Laravel app?
No. The package enumerates rows in Laravel's session storage, so it needs session-based authentication with the database session driver. Token-only APIs built on Sanctum personal access tokens or Passport have no session rows to list. Stateless SPA auth is likewise out of scope.
How do I log out a user's other browser sessions with this package?
You delete the other session rows belonging to the authenticated user, either through the package's session management surface or the provided component, which invalidates those sessions. The same approach lets you terminate all sessions or only the ones the user does not recognize. Check the source for your installed version to confirm exact method names.
Is there a ready-made Blade or Livewire UI component in browser-sessions?
Yes, the package ships a ready-made Blade/Livewire component for listing devices and terminating sessions. You can also skip it and build your own UI against the provided query surface. That decoupling from Jetstream is one of the main reasons to choose this package.
How does browser-sessions detect the device, browser, and IP address?
It reads the user agent and request metadata for each session and stores device, platform, browser, and IP in a metadata table keyed to the session. Last activity is derived from the session record itself. Because the data comes from the user agent, detection is best-effort rather than guaranteed.
Does browser-sessions support multiple guards?
The package is built around Laravel's SessionGuard plus config-driven guard and model wiring, so standard session guards are supported. Multi-guard setups are not documented in detail, so review the config and source before assuming a non-default guard works out of the box.
Are old browser session records pruned automatically, and what about GDPR retention?
There is no documented automatic pruning, so the metadata table will grow unbounded unless you add your own cleanup job or command. IP addresses and device data are personal data under GDPR and CCPA, so define a retention policy and delete stale rows on a schedule. Confirm the recommended retention settings with the maintainer for your version.
How is browser-sessions different from Jetstream's built-in session management?
Jetstream and Fortify already include a profile session panel, so this package is largely redundant if you run Jetstream. Its value is delivering the same capability as a standalone, decoupled package you can customize and reuse outside Jetstream. Adopt it when you want session management without adopting the rest of Jetstream.
Is cjmellor/browser-sessions maintained and safe for production use?
It is a thin layer over Laravel's session internals, so a framework session-layer change can break it between majors; pin versions and regression-test the sessions UI on framework upgrades. The 1.3.x line is now a maintenance branch with no stated support window for teams still on Laravel 10 or 11. Confirm the minimum PHP version and support policy with the maintainer before committing.
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.
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons