Location: PHPKode > scripts > XS PHP Library > xs-php-library/src/session.php
<?php
//
// +--------------------------------------------------------------------------+
// |                                                                          |
// |                   XS PHP Library  Generic Classes Library                |
// |                                                                          |
// |                   Copyright (c) 2001-2002 XSPHPLib Group.                |
// |                                                                          |
// +--------------------------------------------------------------------------+
// |                                                                          |
// | Distributed under the terms of the GNU Lesser General Public License as  |
// | published by the Free Software Foundation version 2.1                    |
// | See the GNU Lesser General Public License for more details. You should   |
// | have received a copy of the GNU Lesser General Public License along with |
// | this package; if not, write to the Free Software Foundation, Inc.,       |
// | 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.                 |
// |                                                                          |
// +--------------------------------------------------------------------------+
// |                                                                          |
// | Authors: Robert Bala <hide@address.com>                                   |
// |                                                                          |
// +--------------------------------------------------------------------------+
//
// $Id: session.php,v 1.2 2002/11/28 09:51:38 rbala Exp $

include_once('../inc/object.inc.php');
include_once('../inc/file.inc.php');
include_once('../inc/sgfiles.inc.php');
include_once('../inc/session.inc.php');

$counter = 0;

$session = new Session();

$session->open();

if ($session->isOpened()) {
    if ($session->exists('counter')) {
        $counter = $session->getParam('counter');
    }
    
    $counter++;
    
    $session->setParam('counter', $counter);
    
    $session->close();
}

echo "Current counter value is: " . $counter;

?>
Return current item: XS PHP Library