Welcome Guest, Not a member yet? Register   Sign In
set_userdata() not work
#11

[eluser]Pakm@n[/eluser]
[quote author="InsiteFX" date="1338178924"]If the timezones are not correct the time for sessions and cookies will not match and cause problems!

If the server is in Mexico then just set the timezone like I showed you above to Mexico.
[/quote]
Actually the default time zone was set on the user controller, and i set it to the login controller and the index.php, but still didn't work.
It's really weird, i will ask my client if it works well down there, if it is i think i souldn't worry about it, but still it kinda worries me a little bit.

I made some tests and it actually goes to the validate credentials and passes the first condition (the username and pass are correct) but it doesn't set the is_logged_in = true on the cookie :-S

You have any other ideas why it isn't working?

Thanks for your help
#12

[eluser]InsiteFX[/eluser]
Try this
Code:
function is_logged_in(){
  $is_logged_in = $this->session->userdata('is_logged_in');
  
  //echo $is_logged_in;
  if ($is_logged_in !== true){
   echo "Necesitas iniciar sesion como usuario para ver este contenido <br />";
   echo anchor('login','Login');
  /*echo "<pre>";
  print_r($this->session->all_userdata());
  echo "</pre>";*/
   die();
  }
}

Note: Cookies can only hold 4KB of data, so be careful not to exceed the capacity. The encryption process in particular produces a longer data string than the original so keep careful track of how much data you are storing.
#13

[eluser]Pakm@n[/eluser]
[quote author="InsiteFX" date="1338205649"]Try this
Code:
function is_logged_in(){
  $is_logged_in = $this->session->userdata('is_logged_in');
  
  //echo $is_logged_in;
  if ($is_logged_in !== true){
   echo "Necesitas iniciar sesion como usuario para ver este contenido <br />";
   echo anchor('login','Login');
  /*echo "<pre>";
  print_r($this->session->all_userdata());
  echo "</pre>";*/
   die();
  }
}

Note: Cookies can only hold 4KB of data, so be careful not to exceed the capacity. The encryption process in particular produces a longer data string than the original so keep careful track of how much data you are storing.[/quote]

Still not working, as you can see i'm printing the data from the session cookie, and well, it doesn't show a is_logged_in index on the cookie array.
It should be created on the login controller but it doesn't create it.

That's the only data i'm storing on the cookie, so it must be less than 4Kb.
It's driving me crazy hahaha
#14

[eluser]InsiteFX[/eluser]
When you run your app do a browser refresh and see if it is still the same!
#15

[eluser]Pakm@n[/eluser]
[quote author="InsiteFX" date="1338227952"]When you run your app do a browser refresh and see if it is still the same!
[/quote]

It's still not working.
I just talked to my client and he says it works fine on chrome
That's weird but well, as long as it works for him, i's fine :-)

Thanks for your help !




Theme © iAndrew 2016 - Forum software by © MyBB