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 Session Management Laravel Package

jeffersongoncalves/laravel-session-management

Laravel Session Management lets you track and manage active user sessions stored in the database, so users can review logged-in devices and revoke or log out other sessions. Lightweight package for secure session control.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • "Log out everywhere" / active sessions UI: Session::forUser() plus SessionManagement::revoke() and revokeUser() make it cheap to ship a security settings screen listing a user's active sessions with per-device revoke — a recurring check-box item in enterprise and consumer security reviews.
  • Incident response and account takeover containment: revoking all sessions for a compromised account becomes a single call rather than a bespoke query, which turns "we can lock a user out in seconds" from a roadmapped promise into a shippable control.
  • Build vs. buy on session tooling: this is a thin read/write layer over Laravel's existing sessions table — it removes the argument for a session-management service or a custom internal admin panel for the common case.
  • Operational hygiene: session-management:prune replaces ad-hoc cleanup queries with a schedulable command, informing decisions about session lifetime (session.lifetime) and database growth.
  • Support and trust & safety workflows: guests(), authenticated(), active(), expired() scopes give support staff self-serve answers ("is this user actually logged in right now?") without engineering involvement.
  • Compliance posture: default masking of _token and password_hash_* in decodePayload() supports safe logging/export in GDPR and audit contexts, reducing review friction.

When to Consider This Package

Adopt when:

  • You use Laravel's database session driver — the package is explicitly bound to session.table / session.connection, so Redis or file sessions are out of scope.
  • You need per-user session enumeration or forced logout as a product feature or security requirement.
  • You want session inspection for debugging/support without instantiating payload objects (a meaningful safety property: unserializing untrusted session data is a classic deserialization risk).
  • You are comfortable with the package reading encrypted payloads via your app's own session.encrypt configuration — verify this before enabling in environments with key rotation or multi-app shared tables.

Look elsewhere or build in-house when:

  • Sessions live outside the database, or you need cross-store visibility.
  • You require session mutation beyond revocation (e.g. extending lifetimes, migrating payloads) or real-time session telemetry — this is a snapshot tool, not an event stream.
  • You need device/geolocation metadata: the release notes mention no IP or user-agent parsing, so the "active sessions" UI may show only IDs and timestamps unless you add columns yourself.
  • You are pre-1.x-adjacent and unwilling to track a young package: this is a first release (1.0.0) with no deprecation or migration history to judge stability by — pin the version and treat upgrades as reviewable.

Open questions to resolve before committing: payload decode behavior across mixed serializers, whether revokeUser() can exclude the current session (essential for "log out other devices"), and whether pruning respects session.lottery so the command doesn't double up on Laravel's built-in GC.

How to Pitch It (Stakeholders)

For executives: A small, focused addition that closes a standard security gap — users and support teams can see and kill active sessions, and we can force-logout a compromised account in one action. It reuses our existing session infrastructure, so there is no new service, no new vendor, and no data migration.

For engineering: A read/write wrapper over Laravel's sessions table that respects session.table, session.connection, session.encrypt, and session.serialization, so it behaves like the framework rather than alongside it. It offers an Eloquent model with user(), scopes (active, expired, guests, authenticated, forUser), a payload decoder that never instantiates objects and masks _token/password_hash_* by default, plus revoke/revokeUser/prune and an artisan prune command for scheduling.

Caveats to state plainly: database driver only; v1.0.0 is the first release, so pin it and expect to review upgrades; session metadata beyond what the table stores (IP, user agent) is on us if we want richer device listings.

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.
gmostafa/php-graphql-client
xeviant/paystack
snowsoft/faker
meditationsteps/blogetc
animalyoung/laravel-influxdb
onix-solutions/sms-telera
lonely-lights/prosetta
oxygen/data
oxygen/core
jengo/base
xiloryx/log-collector
a21ns1g4ts/filament-stripe
la-php/laravel-admin
artisan-build/community-prompts
vleroy/smart
ayles-software/laravel-australian-public-holidays
cboxdk/laravel-id-spatie
cboxdk/laravel-id-billing
cboxdk/laravel-id-billing-bridge
simple-as-fuck/php-performance-log