Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
7.0k views
in Q2A Core by
edited by

Users are getting redirected to register/login page automatically after the page load is complete. I tried work around the module, but not much i could. Can somebody point me in the right direction.

 

I am able to replicate the issue. Found the culprit. its the facebook login creating issues. 
1) Clear all cookies
2) When i reload my website gmatxchange.com, as the page loads this url is called http://www.gmatxchange.com/facebook-login?to=http%3A%2F%2Fwww.gmatxchange.com%2F
 
Q2A version: 1.6.3
by
Is the redirection happening in the main page or any page?
by
not on the main page, but it occurs on the pages like tag, question page
by
Did you make any changes recently that could have caused the problem?
by
nope i reverted the changes. Restored all the code. Still the issue perisists.
I suspect the issue is because of the Register Button, google bot is following this page, is there a way to make it nofollow?

2 Answers

0 votes
by

If non-registered users are redirected to the login/register page when trying to see a question but are allowed to see the questions list then this suggests that the Viewing question pages setting from the Admin > Permissions menu is not set to Anybody. Use that value and check again.

Regarding what you call the "tag" page. What is the URL for that page? Did you mean "tags"?. Regardless of the previous setting you should be able to see the "tags" page but probably you have performed some core modification or installed a custom theme or a plugin that is messing with that.

by
I am able to replicate the issue. Found the culprit. its the facebook login creating issues.
1) Clear all cookies
2) When i reload my website gmatxchange.com, as the page loads this url is called http://www.gmatxchange.com/facebook-login?to=http%3A%2F%2Fwww.gmatxchange.com%2F
by
Oh that FB plugin again! Well I knew it wasn't the core's fault :P But did you manage to fix this or did you just disable the plugin? I checked the site and I do see the FB plugin button but I don't face this behaviour (all pages load properly and I don't get redirected anywhere). I wonder if it is related to some cookie that the FB plugin is adding after logging in and it is improperly processing later
by
Thanks :)

yep i am digging this deeper. found the script area causing the issue.

FB.Event.subscribe('<?php echo $logout ? 'auth.logout' : 'auth.login'?>', function(response) {
           //setTimeout("window.location=<?php echo qa_js($tourl)?>", 100);
         });
I have commented this part now. And understanding further. Basically settimeout is set to 100 secs. so when the user stays on the page for > 100 sec he gets redirected to the login page. Can you suggest a better solution
by
Honestly, I don't know much about the FB plugin nor the FB API. However this might help: http://stackoverflow.com/questions/7553037 . It seems it might be related to FF. I'd take a look at what the effect is of using a window.location.reload() and setting a delay to 0 rather than 100 (I don't think this will change things but it is worth giving it a try)
–3 votes
by
edited by

Reference:

Many my friends are using Clesed Site plugin. Feature of this plugin is not only redirection. This plugin can also customize only pages that does not log in (e.g.:login page, register page, etc). This plugin is small, but has much know-how. Many Q2A engineers come to my site well. At least, it will be helpful for you to investigate my site.

Real example:

...