In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
How to solve the problem that phpcms phpsso cannot exit synchronously? This problem may be often seen in our daily study or work. I hope you can gain a lot from this question. The following is the reference content that the editor brings to you, let's take a look at it!
What if phpcms cannot exit synchronously? Phpcmsv9 phpsso cannot exit synchronously?
Phpcmsv9 comes with a phpsso_server for simultaneous multi-site login and can integrate ucenter. In order not to change too much code, this phpsso is still used when integrating ECSHOP and PHPCMS today.
ECSHOP is very convenient and can communicate with ucenter with a simple configuration. This phpsso has been working for a long time but failed to communicate with ucenter. After hours of deliberation, they finally succeeded in getting them to communicate.
Registration, login, can all be synchronized, but when logging out in phpcms, ECSHOP does not quit, and vice versa.
The cause of the problem:
On the home page, you can see that there is a synchronous logout statement in the logout code of PHPCMS:
$synlogoutstr = $this- > client- > ps_member_synlogout ()
The synchronized logout code looks like this.
/ * * synchronous exit * @ param string $uid * @ return string javascript user synchronous exit js * / public function ps_member_synlogout () {return $this- > _ ps_send ("synlogout', array ());}
Notice that the second parameter to _ ps_send is an empty array.
Then see the constructor of the phpsso class in phpsso_server:
If (isset ($_ POST ["data'])) {parse_str (sys_auth ($_ POST ['data'],' DECODE', $this- > applist [$this- > appid] ['authkey']), $this- > data); if (emptyempty ($this- > data) |! is_array ($this- > data) {exit (' 0');}} else {exit ('0');}
Here is a judgment for $this- > data. If empty returns true, it will return 0 directly and the following synchronization exit code will not be executed. In the previous step, you can see that the data parameter passed in when calling synchronous logout is exactly array (), and empty will of course return true. So the invocation of synchronous exit ends here.
The solution to the problem:
Knowing the reason is easy to solve, there are two main kinds.
The safe way is to add a random element to the empty array in ps_member_synlogout.
The second is to remove the judgment of empty ($this- > data).
Thank you for reading! After reading the above, do you have a general idea of the solution that phpcms phpsso can not exit synchronously? I hope the content of the article will be helpful to all of you. If you want to know more about the relevant articles, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.