[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.