The session in PHP cannot be transferred across pages? A cross page is lost, blank

Source: Internet
Author: User
The session in PHP cannot be transferred across pages? A cross page is lost. it is blank! The last part of this post is edited by MoreQuestion from 2011-03-. for example, first browse the. php file and write a session value in it. Then, browse B. php to get that the session in a PHP cannot be passed 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?


session
Session 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_divisor 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_start();
?>




session set



$_SESSION['session_value'] = 'value';
var_dump($_SESSION);
phpinfo();
?>


The file is normal and the session value can be printed.

B. php
 session_start();
?>

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.