Recently I had this case where a PHP session ($_SESSION) was not being passed from a web site to WordPress.
Basically, WordPress was installed and configured to be part of a web site and there was the need to use Sessions to control the login/logout process of the site.
Although the session_start() had been defined to WordPress, the latter did not recognize the session values and therefore simply ignored if a user was logged on.
After some research and some brainstorming with some great experts on the field, I realized that the problem was in the WordPress URL itself.
The problem was that although the domain was the same, WordPress was suppressing the “www” from the URL which caused the $_SESSION values not to be recognized.
Example:
Site URL: http://www.this-is-an-example.com
WP URL: http://this-is-an-example.com (missing the “www.”)
Solution:
By adding the “www.” to the WordPress domain name the problem was solved:
- Login to WordPress Admin area
- Go to Settings – General
- Add “www.” to the WordPress address (URL) and Blog address (URL).
You made some good points there. I did a search on the topic and found most people will agree with
your blog.
Hello
thanks for this tips
Thanks the author for article. The main thing do not forget about users, and continue in the same spirit.
I’m new around here, seems like a cool place though. I’ll be around a bit, more of a lurker than a poster though 🙂
Berry
Stunning, I did not heard about this topic up to the present. Thanks!!
yo.. interesting :))
Thank you for this. I’ve been trying to solve this problem for hours.
Hi!
I’m glad you like it!
Yes, I plan to write more about this subject soon.
Cheers!
Hi! I like your srticle and I would like very much to read some more information on this issue. Will you post some more?