Welcome Guest, Not a member yet? Register   Sign In
Problem with Session and JQtouch
#1

[eluser]Unknown[/eluser]
Hey everyone,

I'd like to start by saying that I've already developed the working beta version of the app I'm gonna talk about in the following lines. So, how you can deduce from the post title, I'm trying to make a iPhone version of the app with JQtouch. Actually, everything works fine if I open it in any browser in my laptop, but when I open it with my iPod Touch it is not possible to log in. After some testing, I've realised that the problem is in the session data.

When the credentials are checked, if the user exists in the db, I create the session data with the user ID. The code looks like this:
Code:
$this->load->model('users_model');
$user_id = $this->users_model->validate(); //This returns the user id or 0 if not exists
            
if($usuario_id != 0){ //So, if it exists
                
   //We create the session data
   $this->session->set_userdata(array('userid' => $user_id));

   //-------------------------

   redirect('panel');
      
}else{
   redirect('logout');
}
So this is the same code than the one in the regular working app. I've made 2 tests to understand what is goin on:

1) I've printed on the screen the session data just after setting it (in the dashed commented line in the code above). This worked fine.

2) I've tried to print on the screen the session data in the 'panel' controller. Nothing happened, no data set, crap. The users cannot acces to this controller if they are not logged in.


I think the problem can be caused by jQtouch, and the way it acces to the data, but I'm not sure. Do anyone can give me a hand?

Thanks!


PS: Sorry for my English, I don't speak it regularly.




Theme © iAndrew 2016 - Forum software by © MyBB