当前位置: 首页>>代码示例>>PHP>>正文


PHP adodb_sess_gc函数代码示例

本文整理汇总了PHP中adodb_sess_gc函数的典型用法代码示例。如果您正苦于以下问题:PHP adodb_sess_gc函数的具体用法?PHP adodb_sess_gc怎么用?PHP adodb_sess_gc使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了adodb_sess_gc函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: limpiar

function limpiar()
{
    if (rand() % 100 == 0) {
        adodb_sess_gc(100);
    }
    return;
}
开发者ID:BackupTheBerlios,项目名称:facturaphp,代码行数:7,代码来源:tools.php

示例2: print_r

} else {
    $_SESSION['MONKEY'][0] += 1;
}
if (!isset($_GET['nochange'])) {
    @($_SESSION['AVAR'] += 1);
}
### START DISPLAY
print "<h3>PHP " . PHP_VERSION . "</h3>";
print "<p><b>\$_SESSION['AVAR']={$_SESSION['AVAR']}</b></p>";
print "<hr /> <b>Cookies</b>: ";
print_r($_COOKIE);
var_dump($_SESSION['MONKEY']);
### RANDOMLY PERFORM Garbage Collection
### In real-production environment, this is done for you
### by php's session extension, which calls adodb_sess_gc()
### automatically for you. See php.ini's
### session.cookie_lifetime and session.gc_probability
if (rand() % 5 == 0) {
    print "<hr /><p><b>Garbage Collection</b></p>";
    adodb_sess_gc(10);
    if (rand() % 2 == 0) {
        print "<p>Random own session destroy</p>";
        session_destroy();
    }
} else {
    $DB = ADODB_Session::_conn();
    $sessk = $DB->qstr('%AZ' . rand() . time());
    $olddate = $DB->DBTimeStamp(time() - 30 * 24 * 3600);
    $rr = $DB->qstr(rand());
    $DB->Execute("insert into {$options['table']} (sesskey,expiry,expireref,sessdata,created,modified) values ({$sessk},{$olddate}, {$rr},'',{$olddate},{$olddate})");
}
开发者ID:HaakonME,项目名称:porticoestate,代码行数:31,代码来源:testsessions.php

示例3: print_r

  </tr>
  <tr>
    <td valign="top">
<?php 
    echo "<h3>\$USERID = " . $USERID . "</h3>";
    echo "<p><b>\$_SESSION['foo'] = " . $_SESSION['foo'] . "</b></p>";
    echo "<p><b>\$_SESSION['baz'] = " . $_SESSION['baz'] . "</b></p>";
    echo "<p><b>\$_SESSION['hiya'] = " . $_SESSION['hiya'] . "</b></p>";
    echo "<hr> <b>Cookies</b>: ";
    print_r($_COOKIE);
    echo "<br><hr> <b>Sessions</b>: ";
    print_r($_SESSION);
    if (mt_rand() % 2 == 0) {
        echo "<hr><p><b>Garbage Collection</b></p>";
        $time = time() + 6400;
        adodb_sess_gc($time);
    } else {
        if (mt_rand() % 2 == 0) {
            echo "<hr><p><b>Session destroy</b></p>";
            session_destroy();
        } else {
            echo "<hr><p><b>Normal Execution</b></p>";
        }
    }
    ?>
<br>
	</td>
  </tr>
	<tr>
  <td>
    <div align="center">Reload/Refresh the page multiple times.  You should randomly see "Garbage Collection", "Session Destroyed" or "Normal Execution".
开发者ID:jinahadam,项目名称:Keystroke-Dynamics,代码行数:31,代码来源:test_adodb_lite_sessions.php


注:本文中的adodb_sess_gc函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。