1.php<?php
$savePath = './'; 
//  保存一天 
$lifeTime = 24 * 3600;
session_start();
$_SESSION["admin"]="梦飞";
session_save_path($savePath); 
echo $_SESSION["admin"];
?>

解决方案 »

  1.   

      
     处理方法:
      1.找到php.ini配置文件打开.
      2.找到session.auto_start=1 把前面的";"掉。
      3.找到session.save_path = "C:/Temp" 把前面的";"掉。设置你的保存路径即可。 
      <?php
        $_session["admin"]="梦飞";
        echo $_session["admin"];
      ?>
     
      

  2.   

    应该是配置的问题,照楼上的方法试试看。
    1.php
    <?php
        header ("Content-Type:html/text;charset:UTF-8");
        session_start();
        $_session['admin']="梦飞";
    ?>
    2.php
    <?php
         header ("Content-Type:html/text;charset:UTF-8");
         session_start();
         echo $_session['admin'];
    ?>
      

  3.   


    支持,估计你没有打开session!
      

  4.   

    session.auto_start=1 是什么意思?
    我的是 0
      

  5.   

    而且生成的SESSION文件都是没有内容的
      

  6.   

    把你的源文件发至[email protected]我再帮你看看。
      

  7.   

    session_save_path($savePath); 
    这个好象用法不是这样的手册
    session_save_path
    (PHP 4, PHP 5)session_save_path -- Get and/or set the current session save path
    Description
    string session_save_path ( [string path] )
    session_save_path() returns the path of the current directory used to save session data. If path is specified, the path to which data is saved will be changed. session_save_path() needs to be called before session_start() for that purpose. 
    ——————————————————————————session_save_path ( [string path] ),用在start前,而且可能当页有效!要用,可能每人页都要用!
      

  8.   

    你看你的$savePath = './';下是否有session变量文件
      

  9.   

    $_SESSION要大写
    再开启session.auto_start=1 试试吧