Skip to content

PD\Session is a flexible PHP session manager with Redis support and filesystem fallback. Provides secure session handling.

License

Notifications You must be signed in to change notification settings

pardnchiu/php-session

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PD\Session

PD\Session is a flexible PHP session manager with Redis support and filesystem fallback. Provides secure session handling.

tag size
version download

Features

  • Dual storage support (Redis / Filesystem)
  • Automatic fallback mechanism
  • Session security enhancements
  • Built-in session lifetime management
  • Session ID regeneration
  • Creation time tracking

Security Features

  • 7-day session lifetime
  • Automatic garbage collection
  • Session ID regeneration support
  • Secure storage handling
  • System resilience fallback mechanism

Dependencies

  • pardnchiu/redis - For Redis caching support (optional)
  • /storage/sessions - Write permission required for storage directory

How to Use

Installation

composer require pardnchiu/session
// Initialize with Redis support
$redis = new PD\Redis();
$session = new PD\Session($redis);

// Basic session operations
$session->set("user_id", 123);
$userId = $session->get("user_id");
$session->delete("user_id");

// Security operations
$session->regenerateId();   // Regenerate session ID
$session->destroy();        // Destroy session

// Session information
$sessionId = $session->getId();
$createdTime = $session->getCreatedTime();

// Initialize without Redis (filesystem only)
$session = new PD\Session();

License

This source code project is licensed under the MIT license.

Creator

Pardn Chiu


©️ 2024 Pardn Chiu

About

PD\Session is a flexible PHP session manager with Redis support and filesystem fallback. Provides secure session handling.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy