[Query] php's question about session solution

Source: Internet
Author: User
Tags php session
[Ask] I have some questions about session in php. I can see the usage of phpsession on the Internet. 1. phpsession_start (); $ _ SESSION ['passwd'] & quot; mynameislikui & quot; 2. phpsession_start (); echo $ _ SESSION ['passwd']; I use a browser from 1. php jumps to 2. php can [ask] some questions about session in php
I can see php session usage on the Internet.
1. php
Session_start ();
$ _ SESSION ['passwd'] = "mynameislikui ";

2. php
Session_start ();
Echo $ _ SESSION ['passwd'];

I can use a browser to jump from 1. php to 2. php. However, it is a problem that I use a client to write an httprequest.
My test is like this. when I access the response returned by 1. php, I find that there are more http headers.
PHPSESSID = maid
This value is added to the header of the request to access 2. php. But no result is returned.
I don't know if this method is correct, but I feel that the browser has not done anything special, why can it be displayed normally?
I don't know if I have clarified the problem? Please contact us

------ Solution --------------------
What do you want to do? Learning the usage of session in php?

$ _ SESSION ['passwd'] = "mynameislikui ";
Yes, it should be

$ _ SESSION ['passwd'] = "mynameislikui ";


------ Solution --------------------
Yes.
You can use the program to get the response header, and then write this information in the header the next time you send it.

Note that sesssionid stores cookies, which are also constructed in cookies during sending.

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.