The session in PHP cannot be transferred across pages? A cross page is lost. it is blank! This post was last edited by MoreQuestion at 07:57:23
For example, first browse the. php file and write a session value in it.
Then browse B. php to get the session value written by a. php. Empty!
Why? The test is normal on the local machine. The upload server is complete.
Session information of PHPINFO
Session. save_path D:/hosting/user/html/temp
This folder is readable and writable.
When you browse the. php page, a large file is generated and the session value is saved.
When you browse the B. php page, a file of 0 size is generated. Not available? Why?
sessionSession Support enabled Registered save handlers files user Registered serializer handlers php php_binary wddx Directive Local Value Master Value session.auto_start Off Off session.bug_compat_42 On On session.bug_compat_warn On On session.cache_expire 180 180 session.cache_limiter nocache nocache session.cookie_domain no value no value session.cookie_httponly Off Off session.cookie_lifetime 0 0 session.cookie_path / / session.cookie_secure Off Off session.entropy_file no value no value session.entropy_length 0 0 session.gc_pisor 100 100 session.gc_maxlifetime 1440 1440 session.gc_probability 1 1 session.hash_bits_per_character 4 4 session.hash_function 0 0 session.name PHPSESSID PHPSESSID session.referer_check no value no value session.save_handler files files session.save_path D:/hosting/user/html/temp session.serialize_handler php php session.use_cookies On On session.use_only_cookies Off Off session.use_trans_sid 1 1
A. php
session set
The file is normal and the session value can be printed.
B. php
session get
Nothing.
Reply to discussion (solution)
Var_dump ($ _ SESSION ['session _ value']);
Is that the same on your server?
Session. save_path D:/hosting/user/html/temp
You may find the directory locally. Is there a directory on your server?
It indicates that the above code is correct. you can test it locally. the server is not tested yet. you can consider the suggestions on the second floor.
Is there a cross-domain relationship between a and B?
Is that the same on your server?
Session. save_path D:/hosting/user/html/temp
You may find the directory locally. Is there a directory on your server?
On the server, I set this to a omnipotent folder, which can write everything.
Var_dump ($ _ SESSION ['session _ value']);
No, no value ......
Why? The server is IIS. But it is impossible. in this way, the local environment is virtualized to test, but it still looks like this, and it hurts me.
I can display the values after session_id (1) on both pages, but this will not work for multiple users.
Browser problems?
What are the browser problems?
I use IE6 to IE9 ...... Not changed.
Session_id (SID );
Session_start ();
Session_id (SID );
Session_start ();
Is SID a constant?
Have you solved this problem? I just encountered this problem today, but I still failed to solve it after a day!
I hate the php session.