0

I'm trying to make a cakephp project work on my local computer, after setting up everything the login page works perfectly, after login in I'm getting this error: enter image description here

and this is the code of line 111: enter image description here

some help please!

My friends have the same code and it's working for them

Lara
  • 23
  • 6
  • It doesn't answer my question, I think the problem is in my php.ini but I don't know what is it – Lara Jul 15 '20 at 15:02
  • what is the output of `var_dump($usu)` – meewog Jul 15 '20 at 15:03
  • @MehrdadDastgir the output is null – Lara Jul 15 '20 at 15:14
  • then seems like the user doesn't have a session saved – meewog Jul 15 '20 at 15:16
  • @MehrdadDastgir but my friends have the same thing and it's working for them – Lara Jul 15 '20 at 15:16
  • your query is not send the value to you, please check the what value you get from model and go for next – Rohit Jadhav Jul 15 '20 at 15:30
  • output cannot be null because you are checking for this in line 109. so again, try to var_dump($usu) after line 108 – meewog Jul 15 '20 at 15:40
  • @MehrdadDastgir yes I did it after the line 108 and it's a null – Lara Jul 15 '20 at 15:46
  • then your if statement on line 109 would not be true and you wouldn't get the exception you got. The fact that you got it shows $usu AKA user session was not null and in fact did have a UID key – meewog Jul 15 '20 at 15:57
  • @MehrdadDastgir yes I'm supposed to get a uid but I don't and I couldn't figure out why?! what makes me more confused is that the project as it is, is working for my friends while it doesn't for me!! – Lara Jul 15 '20 at 16:03
  • do you have an authenticated user? – meewog Jul 15 '20 at 16:03
  • @MehrdadDastgir yes I have – Lara Jul 15 '20 at 16:06
  • @MehrdadDastgir could the problem be in my configuration? – Lara Jul 15 '20 at 16:09
  • @Lara I am sorry, not saying you are wrong, but the example presented above shows the value of $usu is not null. try again to var_dump after having a correct session. Also what you are doing in line 111 is redundant, you can simply remove it – meewog Jul 15 '20 at 16:14
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/217908/discussion-between-lara-and-mehrdad-dastgir). – Lara Jul 15 '20 at 16:22
  • @MehrdadDastgir I've done the var_dump and I'm getting array(0) { } – Lara Jul 15 '20 at 16:28

0 Answers0