session : simple question

Discussion in 'PHP' started by bartolay13, Sep 14, 2008.

  1. #1
    how to print out all active sessions in a page?
     
    bartolay13, Sep 14, 2008 IP
  2. php-lover

    php-lover Active Member

    Messages:
    261
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    58
    #2
    $dir = session_save_path();
    
    $handler = opendir($dir);
    
    while(false !== ($files = readdir($handler))){
    
          echo 'Session file: '.$files.'<br';
    
    }//end while
    
    closedir($handler);
    PHP:


    ==============

    or you can try this.

    print_r($_SESSION);
     
    php-lover, Sep 14, 2008 IP