An IP access site could not store session variables for the first time to encounter such a strange problem.
Please look at the code first, the test PHP page code is as follows:
PHP Code
'; Echo ' ID: '. session_id (); $_session["Count"]= $count;? >
----------------------------------
Without a doubt, this code is absolutely correct, test the results on the local Php5.2+apache host:
------------------
= = First time Refresh page = =
Count:1
Id:60499dfb22e443a89f5f8ef161570fb0
= = Second time Refresh page = =
Count:2
Id:60499dfb22e443a89f5f8ef161570fb0
= = Third Refresh page = =
Count:3
Id:60499dfb22e443a89f5f8ef161570fb0
------------------
However, when I put this piece of code into a Web page and upload it to a php5.2+apache space I bought in the United States, the problem comes!!
Use my local network to access the test results for this page:
------------------
= = First time Refresh page = =
Count:1
Id:b8611df96a9371f930d8838c0cbc5d77
= = Second time Refresh page = =
Count:1
Id:3ae67bfa8cdf1d116e1c763fb8f7e2d8
= = Third Refresh page = =
Count:1
Id:e2fc2942aeb87f63ce2253b0e6cc3a4d
------------------
See above results, my first reaction is the php.ini in the session set problems, the results over and over the verification for a long time, and take the local php.ini file upload coverage, the results are the same.
Then empty the Ff\ie cache with cookies, etc., or the same. Another computer to change the network access, the results are still not.
No way, then I can only think of the server has a problem, then find a service provider to solve. Service provider for a day, tell me that the server is not a problem, they test the page results are correct.
At this time I am very angry, my side obviously test result is wrong, how can you? Can it be My network problem? I'll hang up right away proxy IP software to access My site, the results get the correct results!!! Then with an online proxy IP site for access, the results are correct!!
At this time I am depressed!! What's the situation? Supposedly, the foreign server IP is easily blocked by domestic ISP service providers, resulting in the situation of domestic inaccessible. But, what's the situation? Obviously can access, that is, every visit will produce a new session ID, view Session_save_path cache folder, but also special cache files, what is the situation, really do not understand.
Please eldest brother elder sister, hero Shrimp help, it is really collapsed!!! Humbly
------Solution--------------------
My visit is good, just a little slower. Where's your server? Lets you output phpinfo information. There are you so frequent operation of the session is not good, the session is server-side.
------Solution--------------------
I tested, your server session is normal. The problem is not that the server is on your own network or computer.
------Solution--------------------
has been tested, no problem.
------Solution--------------------
It is impossible to have a connection with the network, is it possible for your bag to get rid of the cookie halfway?
Obviously your browser does not save cookies, and you grab a packet to see if your request is not with a cookie every time.