memcache 形式的 SESSION 设置、开启、操作

    php 扩展

    1. 需要开启 php_memcache 扩展

    memcache 相关知识: http://www.hcoder.net/books/read_10090.html

    在入口页面( index.php )设置并开启 session

    1. <?php
    2. define('PG_SESSION_TYPE', 'memcache'); //类型为 memcache
    3. define('PG_SESSION_HOST' , 'tcp://127.0.0.1:11211'); // memcache 服务器地址及端口
    4. define('PG_SESSION_START', true); //开启 session

    设置 seesion - setSession($name, $val)

    1. 参数:1session 名称2、对应的值

    获取 session - getSession($name)

    1. 参数:session 名称

    删除 session - removeSession($name)

    1. 参数:session 名称

    原文: http://www.phpgrace.com/doc/info/310-4.html