502 error occurred when saving cookies. solution:

Source: Internet
Author: User
Tags subdomain name
The 502 error occurred when saving cookies. we made an application website. The server is linux.
After successful login, an interface will be provided to save the user's cookie.
But it is not saved successfully. at least the code is normal,

But they all use one domain name.
We use a subdomain name to resolve it to our server.
The primary domain name is www. XXXX.
Our application domain name is edu. XXXX

When this cookie is added, the 502 Bad Gateway appears.

The code is as follows:

Header ('p3p: CP = "CURa ADMa DEVa PSAo PSDo our bus uni pur int dem sta pre com nav otc noi dsp cor "');

Setcookie ("USERID", $ useridjsyd, time () + 3600*4 ,'/');
Setcookie ("UTYPE", $ utypejsyd, time () + 3600*4 ,'/');
Setcookie ("NICKNAME", $ nicknamejsyd, time () + 3600*4 ,'/');
Setcookie ("MOBID", $ mobidjsyd, time () + 3600*4 ,'/');
Setcookie ("GRADECODE", $ gradecodejsyd, time () + 3600*4 ,'/');
Setcookie ("ACCID", $ accidjsyd, time () + 3600*4 ,'/');
Setcookie ("NAME", $ namejsyd, time () + 3600*4 ,'/');
Setcookie ("userid", $ accid, time () + 3600*4 ,'/');
Setcookie ("userpwd", $ passwdjsyd, time () + 3600*4 ,'/');
Setcookie ("ZXYQ_UTYPE", 1, time () + 3600*4 ,'/');


Reply to discussion (solution)

Tested in many aspects
The cookie is saved after the first login.
But this error is returned if you exit and increase the cookie value.

It seems that the Internet cookie cannot be modified.
But the intranet can

The configuration file is:
Session
Session Support enabled
Registered save handlers files user sqlite
Registered serializer handlers php php_binary

Directive Local Value Master Value
Session. auto_start Off
Session. bug_compat_42 Off
Session. bug_compat_warn Off
Session. cache_expire 180 180
Session. cache_limiter nocache
Session. cookie_domain no value
Session. cookie_httponly Off
Session. cookie_lifetime 0 0
Session. cookie_path //
Session. cookie_secure Off
Session. entropy_file no value
Session. entropy_length 0 0
Session. gc_pisor 1000 1000
Session. gc_maxlifetime 1440 1440
Session. gc_probability 1 1
Session. hash_bits_per_character 5 5
Session. hash_function 0 0
Session. name PHPSESSID
Session. referer_check no value
Session. save_handler files
Session. save_path no value
Session. serialize_handler php
Session. use_cookies On
Session. use_only_cookies On
Session. use_trans_sid 0 0

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.