php - CakeSession::write() Not working on remote server, but works fine on localhost -
I have this code that authenticates the user for login and it works fine on the local host, but remote Does not work on the server. It just loads and lasts on the login page. But when the username or password is incorrect, then it returns the error message well.
If ($ this - & amp; - Request-> ('Post')) {$ data = $->; Request & gt; Data; $ Password = sha1 ($ data ['password']); $ Email = $ data ['email']; $ AuthUser = $ the- & gt; User- & gt; Search ('first', array ('conditions' = & gt; array ('user.mail' = & gt; $ email, 'user password' = & gt; $ password)); If (calculate ($ authUser)> 0) {cake sensation :: compose ('logged in user', $ authUser ['user'] ['' id ']); Cake sensation :: write ('log inname', $ and user ['user'] ['first_name']). "$ AuthUser ['user'] ['last_name']); Cake sensation :: write ('verstatus', $ and user ['user'] ['verified']); If (empty! = Cake sensation :: read ('logged in user')) {$ this-> Redirect ('/ shop'); }} And {$ loginError = 'Invalid user name or password'; $ This- & gt; Set ('invalid', $ login error); }} Is there any idea of what is happening to any one? Try to use my Cakephp version 2.5.4
$ This - & gt; Session-> Write ('login name', $ authUser ['user'] ['first_name']. ''. $ AuthUser ['user'] ['last_name']); Session-> for reading.
Similarly. And check the PHP version on both sides.
Read
Also clear the cache, floating folder, switch core.fp - & gt; Debug to 2, again to 0
Comments
Post a Comment