歡迎光臨, 訪客. 請先 登入註冊一個帳號.
四月 16, 2024, 06:40:47 下午
19595 文章 在 3865 主題 由 4580 會員
最新註冊會員: aa123aa1
LifeType 中文開發論壇  |  開發  |  外掛程式  |  那位大大可以帮忙解答1下 这个SESSION 有关的问题 万分感谢 « 上篇主題 下篇主題 »
頁: [1]
作者 主題: 那位大大可以帮忙解答1下 这个SESSION 有关的问题 万分感谢  (閱讀 6562 次)
adriano_lee
新手見習
*
文章: 2


檢視個人資料
« 於: 十月 08, 2007, 11:25:38 下午 »

我做了一个 test.php 放在lifetype 下面和admin.php 一起的,这个test.php主要是用来负责自动产生登陆SESSION 的 现在问题是 我的 SESSION  的确是产生了 但是 只在test.php 里面可以看到 在 admin.php 里看不到 但是我新建立一个TEST1。PHP 也可以看到 请问是怎么回事?我那里设置错了么

test.php
程式碼:
<?
    if (!defined( "PLOG_CLASS_PATH" )) {
        define( "PLOG_CLASS_PATH", "F:\AppServ\www\lifetype/");
    }


    include_once( PLOG_CLASS_PATH."class/bootstrap.php" );
    include_once( PLOG_CLASS_PATH."class/controller/admincontroller.class.php" );
    include_once( PLOG_CLASS_PATH."class/net/http/session/sessionmanager.class.php" );
    include_once( PLOG_CLASS_PATH."class/dao/userinfo.class.php" );
include_once( PLOG_CLASS_PATH."class/dao/users.class.php" );
    include_once( PLOG_CLASS_PATH."class/dao/bloginfo.class.php" );
    //include_once( PLOG_CLASS_PATH."class/plugin/pluginmanager.class.php" );
    //include_once( PLOG_CLASS_PATH.'class/template/templatesets/templatesets.class.php' );

include_once( PLOG_CLASS_PATH."class/action/action.class.php" );
    include_once( PLOG_CLASS_PATH."class/view/admin/admindashboardview.class.php" );
    include_once( PLOG_CLASS_PATH."class/view/admin/admindefaultview.class.php" );
    include_once( PLOG_CLASS_PATH."class/dao/users.class.php" );
    //include_once( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
    include_once( PLOG_CLASS_PATH."class/net/http/session/sessioninfo.class.php" );
include_once( PLOG_CLASS_PATH."class/config/config.class.php" );
include_once( PLOG_CLASS_PATH."class/misc/version.class.php" );
include_once( PLOG_CLASS_PATH."class/locale/locales.class.php" );
include_once( PLOG_CLASS_PATH."class/data/validator/stringvalidator.class.php" );
include_once( PLOG_CLASS_PATH."class/view/admin/adminnewpostview.class.php" );


    ini_set("arg_seperator.output", "&amp;");
    ini_set("magic_quotes_runtime", 0 );
    // initialize the session

    SessionManager::init();

// 產生一個新的 user 物件
$users = new Users();
// 取得 userInfo 物件 (透過正確的 username 與 password)
$userName="test5";
$userPassword="111111";
$userInfo = $users->getUserInfo( $userName, $userPassword );
// 取得使用者的 blog list
$userBlogs = $users->getUsersBlogs( $userInfo->getId(), BLOG_STATUS_ACTIVE );
// 用第一個 blog 來當作 blogID,並取得這個 blog ID 的 blogInfo
$blogInfo = end( $userBlogs );
// 取得 session
//echo "<pre>";

$session = HttpVars::getSession();
$sessionInfo = $session["SessionInfo"];
// 並且把資料寫入session
$sessionInfo->setValue( "userInfo", $userInfo );
$sessionInfo->setValue( "blogInfo", $blogInfo );
$session["SessionInfo"] = $sessionInfo;
HttpVars::setSession( $session );
echo "<pre>";print_R($_SESSION);
?>
« 最後編輯時間: 十月 08, 2007, 11:48:13 下午 由 adriano_lee » 已記錄
頁: [1]
LifeType 中文開發論壇  |  開發  |  外掛程式  |  那位大大可以帮忙解答1下 这个SESSION 有关的问题 万分感谢 « 上篇主題 下篇主題 »
    前往: