Download the PHP package cjmellor/browser-sessions without Composer

On this page you can find all versions of the php package cjmellor/browser-sessions. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package browser-sessions

Latest Version on Packagist Total Downloads Packagist PHP Version Laravel Version

[!WARNING]

This package can only be used with the database driver for the Sessions. This is how it is done in Jetstream, so keep this in mind as it may turn you off knowing you need to manage sessions in the database.

Logout Other Browser Sessions

This package allows you to log out sessions that are active on other devices.

You may find this useful if you have logged in on a different device, or you have let someone else use your account, or you have forgotten to log out of a public computer. It can especially be useful if you see suspicious device activity on your account.

[!NOTE]

This code has been extracted from Laravel Jetstream and cannot be used outside a Laravel application.

Installation

You can install the package via Composer:

Publishing the Configuration

To publish the configuration file for this package, run the following Artisan command:

This will copy the browser-sessions.php configuration file to your application's config directory, allowing you to customize its settings.

Configurable Options

You can customize the following options in the published config/browser-sessions.php file:

include_session_id: (default: false)

Usage

Retrieving A User's Current Sessions

Use the BrowserSessions facade to retrieve all the current user's sessions:

This will return an object with some information about each session:

Logging Out Other Browser Sessions

Use the BrowserSessions facade to log out all the user's other browser sessions:

[!NOTE]

A password must be sent along to the method to confirm the user's identity. Only then will the sessions be removed. See below on how you would implement this.

Views

The package does not come with any pre-defined views to use. Here is an example though on how this could be implemented

In your routes/web.php file add the following route:

Then in your view, you can add a form to submit a DELETE request to the above route:

Retrieve the Users' Last Activity

Get the users' last activity by using the getUserLastActivity method:

You can also view the date in a human-readable format:

Credits

License

The MIT Licence (MIT). Please see Licence File for more information.


All versions of browser-sessions with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^10.0|^11.0|^12.0
jenssegers/agent Version ^2.6
spatie/laravel-package-tools Version ^1.14
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package cjmellor/browser-sessions contains the following files

Loading the files please wait ....