Ignore:
Timestamp:
03/30/10 17:38:44 (14 years ago)
Author:
niltonneto
Message:

Ticket #1018 - Corrigido validação de sessão em requisições AJAX.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0/header.session.inc.php

    r2178 r2391  
    1111        if (empty($_SESSION['phpgw_session']['session_id']) || ($_SESSION['connection_db_info']['user_auth'] && implode('',$_SESSION['connection_db_info']['user_auth']) !== $connection_id)) 
    1212        { 
    13                 if($_SESSION['connection_db_info']['user_auth']) 
     13                if($_SESSION['connection_db_info']['user_auth'] && !strstr($_SERVER['SCRIPT_URL'],"/controller.php")) { 
    1414                        error_log( '[ INVALID SESSION ] >>>>' . implode('',$_SESSION['connection_db_info']['user_auth']) . '<<<< - >>>>' . $connection_id . '<<<<', 0 ); 
    15                 setcookie("PHPSESSID","",0); 
    16                 setcookie ("sessionid","",0);    
    17                 unset($_SESSION); 
     15                        @require_once dirname( __FILE__ ) . '/logout.php'; 
     16                } 
     17 
     18                setcookie(session_name(),"",0); // Removing session cookie. 
     19                unset($_SESSION);                               // Removing session values. 
     20                // From ExpressoAjax response "nosession" 
     21                if(strstr($_SERVER['SCRIPT_URL'],"/controller.php")){ 
     22                        echo serialize(array("nosession" => true)); 
     23                        exit; 
     24                } 
     25        } 
     26        else{ 
     27                // From ExpressoAjax update session_dla (datetime last access).  
     28                if(strstr($_SERVER['SCRIPT_URL'],"/controller.php")) 
     29                        $_SESSION['phpgw_session']['session_dla'] = time(); 
    1830        } 
    1931?> 
Note: See TracChangeset for help on using the changeset viewer.