When writing the php verification code page, I stored the php file on the Sina cloud server and thought about using ajax request session to verify the verification code on the javascript page. I think this method should be feasible, however, in actual operations, it is found that the session obtained using ajax is always empty ,... before writing
Php verification codeWhen the page is accessed, the php file is stored on the Sina cloud server.
javascriptUse ajax requests on the page
sessionTo verify the verification code, I feel that this method should be feasible, but in actual operation, it is found that
ajaxObtained
sessionIt has been blank and has not been requested. one is wrong code, meditation, various queries, and finally found that netizens said Sina Cloud could not save
sessionBut I use
formYou can get
sessionValue. why...
Reply content:
Before writingPhp verification codeWhen the page is accessed, the php file is stored on the Sina cloud server.javascriptUse ajax requests on the pagesessionTo verify the verification code, I feel that this method should be feasible, but in actual operation, it is found thatajaxObtainedsessionIt has been blank and has not been requested. one is wrong code, meditation, various queries, and finally found that netizens said Sina Cloud could not savesessionBut I useformYou can getsessionValue. why...
If the framework is not used, session_start () must be at the beginning of the PHP file, and $ _ SESSION will be used in the file for the function.