Skip to content

gmbelart/CheckSession

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

CheckSession

Check all active session

Example


require 'CheckSession.php';
session_start();
date_default_timezone_set('Asia/Jakarta');

// remove a session that not active more than 2 minutes
CheckSession::removeSession(2);

// check if session is full
// only 2 allowed
if(CheckSession::isFull(2)){
    echo "Sorry, the user has full";
}else{
    $_SESSION['user'] = rand(1, 10);
}

// user is login? 
if(isset($_SESSION['user'])){
    echo 'User has login';
    echo '
'; echo CheckSession::countSession(); echo '
'; }

About

Check all active session

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages