cakephp 2.6.1 ajax login not working -
There are problems with logging in with AJAX Can someone tell me some documents that are understandable. It seems worrisome.
2.x $ in-> at-> login ($ -----> Request-> data) The user will log in whatever data is posted, while $ 1.3 in The-> auth-> login ($ the-> data) will attempt to identify the user and will only log in if successful.
$ data ['user'] ['email'] = "this"; $ Data ['user'] ['password'] = "this"; $ data = $ this-> Request-> Input ('json_decode' is true); $ This- & gt; Autorander = False; $ This- & gt; Feedback & gt; Type ('json'); If ($ this-> AUTH- & gt; Login ($ data)) {echo "access"; } And {echo "access denied"; } It always prints "Access"
AppController.php
'Auth' = & gt; Array ('loginRedirect' => Array ('Controller' = & gt; 'Post', 'Action' => gt; 'Index'), 'Logout Redirect' => Array ('Controller' = & gt; ; 'Page', 'array (' field '= & gt; array (' username '= & gt;' e-mail '),' privacy '=> array (' form '= & gt; password hash '= & Gt;' bluffish '),),
Use instead This (and clearly) can be done better Your code tells me that you have Jakesen at CakePHP. Do not experience.
Check the manual Also, your request should be done with "Approve: App / JS", then your data will end in $$ -> request-> data It is normal to send an acknowledged header and not dependent on the extension, it is normal and is not specific to KPHP only.
Comments
Post a Comment