Javascript-Sina Cloud server can only use form to request to the session, but ajax cannot request ??

Source: Internet
Author: User
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.


  

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.