Welcome Guest, Not a member yet? Register   Sign In
Session lost in ie6 using Ajax
#1

[eluser]Unknown[/eluser]
Hi, i am a loading pages with ajax. but i lost the session with internet explorer 6 .

I make a call with ajax to a function of the controller , and make an echo , for ajax, and javascript replace the code from that the function return in the html cell.

but when i did this i lost the session only with ie Sad.


controller code
Code:
function estaCursoDisponible( ) {
$this->load->library('session');
$this->load->database();
$curso =  $_POST["cursoId"];
$query = $this->db->query("SELECT *  FROM Modulo WHERE CursoId = '$curso'");
//echo  $query->num_rows();
echo  $this->session->userdata('cedula') ;

}

javaScript Code

Code:
function estaCursoDisponible( url , cursoId, moduloId   ){

    var ajax = xmlhttp();    
    var valores  = 'moduloId='+moduloId
    +'&cursoId;='+cursoId;    
    ajax.onreadystatechange=function(){
            if(ajax.readyState==1){        
                    
                    document.getElementById("cargandoCurso")[removed] =  "<img src='../Buscador/loading.gif' alt='cargando...'>";
                }
            if(ajax.readyState==4){
                    
                    alert( ajax.responseText  );
                    
                    if (  ajax.responseText   == 0 ){
                        
                        alert("Este curso aun no tiene modulos disponibles, intenta acceder a otro");
                        document.getElementById("cargandoCurso")[removed] ="";
                        
                    }
                    else {
                        
                        
                        //cargarPagina(url, cursoId, moduloId );
                    
                    }                          
                }
        }        
    ajax.open("POST",'./capacitate/estaCursoDisponible',true);    
    ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
    ajax.send(valores);    
}

this code alert( ajax.responseText );

should print $this->session->userdata('cedula') ; but its prints null.
pdta: just in ie6
#2

[eluser]paulc010[/eluser]
Are you using the default value for $config['sess_cookie_name'] in config.php? If so, then try removing the underscore and see if it helps.

Further reading: http://ellislab.com/forums/viewthread/148442/

Paul
#3

[eluser]Unknown[/eluser]
i have replace the session library with the native session made by Dariusz Debowczyk, and every thing works fine, now,

thanks a lot.




Theme © iAndrew 2016 - Forum software by © MyBB