Source for file xt_sessionscope.class.php
Documentation is available at xt_sessionscope.class.php
*@=@=@=@ START LICENSE @=@=@=@*
Copyright or © or Copr. Stéphane TRICHET and Nicolas SOTRON
stephane.t@simpliciweb.net and nicolas.s@simpliciweb.net
This software is a computer program whose purpose is to make a
This software is governed by the CeCILL license under French law and
abiding by the rules of distribution of free software. You can use,
modify and/ or redistribute the software under the terms of the CeCILL
license as circulated by CEA, CNRS and INRIA at the following URL
"http://www.cecill.info".
As a counterpart to the access to the source code and rights to copy,
modify and redistribute granted by the license, users are provided only
with a limited warranty and the software's author, the holder of the
economic rights, and the successive licensors have only limited
In this respect, the user's attention is drawn to the risks associated
with loading, using, modifying and/or developing or reproducing the
software by the user in light of its specific status of free software,
that may mean that it is complicated to manipulate, and that also
therefore means that it is reserved for developers and experienced
professionals having in-depth computer knowledge. Users are therefore
encouraged to load and test the software's suitability as regards their
requirements in conditions enabling the security of their systems and/or
data to be ensured and, more generally, to use and operate it in the
same conditions as regards security.
The fact that you are presently reading this means that you have had
knowledge of the CeCILL license and that you accept its terms.
*@=@=@=@ END LICENSE @=@=@=@*
* @version $Id: xt_sessionscope.class.php 602 2007-07-18 16:18:38Z stephanet $
* Manage a session scope with PHP session and database for security
* @version $Id: xt_sessionscope.class.php 602 2007-07-18 16:18:38Z stephanet $
* Database Connexion object
var $req_update =
"update t_session set ses_modified=now()
var $req_insert =
"insert into t_session(ses_id,ses_created,ses_modified)
values('%s',now(), now());";
where DATE_ADD(ses_modified, INTERVAL %d MINUTE) < NOW();";
* Constructor, init the requests and objects. And attempt to load a session
* @param string $p_session_name
//echo("<br />INIT Session");
* Get database id for the session id
* Destroy if needed (if exist)
//if ($this->m_must_be_destroyed)
//echo("<br />must be destruct");
//echo($this->m_session_name);
//$_COOKIES[$this->m_session_name] = "";
// session_set_cookie_params (time() - 3600);
//@setcookie($this->m_session_name, '', time() - 3600);
/*function mustBeDestroyedDebuger() {
if ($this->m_must_be_destroyed)
echo("<br />must be destruct");
echo("<br />must NOT be destruct");
unset
($_SESSION[$p_name]);
* @param bool $p_force_to_load
$len_of_php_self =
strlen($_SERVER['PHP_SELF']);
if (((substr($_SERVER['PHP_SELF'], $len_of_php_self -
3) ==
".js")) ||
(substr($_SERVER['PHP_SELF'], $len_of_php_self -
4) ==
".css")) {
$p_force_to_load ==
false) {
//echo("<br />run real or not Session");
if (!$is_existing_session &&
!$p_force_to_load) {
//echo("<br />set to not real :".session_id());
} else if (!$is_existing_session &&
$p_force_to_load) {
//echo("<br />is creating");
echo("<br />end default loading");
if ($this->m_must_be_destroyed)
echo("<br />must be destruct");
echo("<br />must NOT be destruct");
* Force to load a session
* Force to clean in database
* Generate unique id : max of 35 charater generated
* @return bool TRUE on error
* @return bool TRUE on error
// on clean les sessions obsolètes
// preparation des paramètres
* @return bool TRUE on error
// preparation des paramètres
* @return bool TRUE on error
// preparation des paramètres
* @param bool $r_bool_is_existing
* @return bool TRUE on error
function xExist($p_id, &$r_bool_is_existing) {
$r_bool_is_existing =
false;
// preparation des paramètres
$r_bool_is_existing =
true;
Documentation generated on Tue, 25 Mar 2008 15:37:38 +0100 by phpDocumentor 1.3.2