temant/session-manager

A comprehensive PHP utility class for secure and efficient managing sessions.

2.0.1 2024-02-06 09:04 UTC

This package is auto-updated.

Last update: 2024-05-06 09:28:49 UTC


README

Temant\Session is a PHP package that simplifies session management in PHP applications. It provides an easy-to-use interface for starting and managing sessions, setting and getting session variables, and more.

Table of Contents

Installation

You can install this package via Composer: composer require yourusername/temant-session

Usage

To start using this package, follow these simple steps:

Require your composer autoloader:

require_once('path/to/vendor/autoload.php');

Create a Session Instance:

use Temant\SessionManager\Session;

Create a new session instance

$session = new Session();

Start a new session:

$session->start();

Set a session variable:

$session->set('user_id', 123);

Get the value of a session variable:

$userID = $session->get('user_id');

Check if a session variable exists:

if ($session->has('user_id')) {
    // Do something
}

Remove a session variable:

$session->remove('user_id');

Regenerate the session ID:

$session->regenerate();

Destroy the session:

$session->destroy();

Contributing

Contributions are welcome! If you'd like to contribute to this project, please follow our Contribution Guidelines.

Issues

If you encounter any issues or have suggestions for improvement, please report them in the Issue Tracker.

License

This package is open-source software licensed under the MIT License. See the LICENSE file for more information.