Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

Q2A and Wordpress 4.7.2 - Can't login anymore

+3 votes
169 views
asked Feb 8 in Q2A Core by PeterS
Hi,

I have installed Q2A 1.7.4 for wordpress on my localhost (windows XAMPP) and everything was working quite well. Then I logged out and now I can't login to Q2A anymore. When I click on login, i get redirected to the wordpress login. I login as admin, login succeeds and redirects me back to the Q2A site. But there, I'm not logged in...

What am I doing wrong? Wordpress did an automatic update to 4.7.2 nearly at the same time, may that be the reason?

There are no log messages generated in the apache error.log. My installation directories:

htdocs/wordpress

htdocs/question2answer

Thanks for your help!

2 Answers

+2 votes
answered Feb 9 by PeterS
 
Best answer

Ok I found the answer myself. I just wasn't reading the installation description carefully enough. When you have your wordpress and question2answer folders on the same level (like me) the description tells you that you have to add the line define('COOKIEPATH', '/'); to the wp_config.php.

I was adding it to the qa-config.php. So that's why question2answer always thought I'm not logged in. It had no access to the cookies that indicate that you are logged in.

commented Feb 9 by ProThoughts
Good to know that.

can you please explain step by step how to integrate wordpress and q2a. May be helpful to some in future. Thanks!
commented Feb 10 by PeterS
The installation guide the Q2A site provides for the wordpress integration which i linked to is already a very detailed step by step guide. You just have to read carefully in which config file you have to put which line of code because there names look similar (if you read too fast): wp_config.php vs. qa-config.php

So to prevent this in the future maybe a sentence like this: "put the following line of code into wp_config.php" could be changed into "put the following line of code into the wordpress configuration file (wp_config.php)".
commented Feb 11 by ProThoughts
Ok, thank you.
+1 vote
answered Feb 8 by ProThoughts
Just checked wordpress version log, I dont see any major changes. Can you restart your server and check again. Let us know if that works.

https://codex.wordpress.org/Version_4.7.2#List_of_Files_Revised
commented Feb 9 by PeterS
Thanks for your answer!

I just restarted XAMPP and the problem still appears. Is there any configuration that I did wrong that could lead to this effect? I just double checked the guide on how to install Q2A for wordpress and for me it looks like I have done everything in the correct way.

I'm thinking about switching from the wordpress user system to the Q2A native user system as I don't have a blog anyway.
...