Tips and Tricks HQ Support Portal › Forums › WP Affiliate Platform › Cant log into Affiliate Area at all. please help
- This topic has 9 replies, 2 voices, and was last updated 13 years, 10 months ago by HBin123.
-
AuthorPosts
-
January 6, 2011 at 10:01 am #405HBin123Member
Hi,
We still have problems logging into the Affiliate Area as members.
When we log in as members, everything is working fine in eMember and each membership level can view the pages we have given them permission to view. Everything is working fine there.
But when a member that is logged in try to go to the Affiliate area it ask the member to log in again. We have set the correct option in eMember to automatically log in to the Affiliate Area. So, when that member then try to login using the login button, it redirects to the homepage. By clicking on the Affiliate Menu option again, it takes the member back to the login page there It simply wont give access to the Affiliate Area.
We have tried to log in using IE8, FF, CHROME and SeaMonkey (Mozilla too). So this cant be a browser related issue either. I have tried to clear all Cache and Cookie + reset Modem without it helping.
Since everything else is working on our site it cant be a cookie/cache problem. The problem has to be somewhere in this Affiliate Plugin but we cant find out where the problem is.
We are using eMember Version 5.9.8 and Affiliate Platform version 4.4.0
Can you please help us?
Best Regards
Monica
January 6, 2011 at 11:22 am #27775HBin123MemberHello,
This is Kevin, the developer for Monica. I have been trying to find any clues about this problem and have some information that may help you.
Firstly, I want to confirm that we completely deleted the plugins, deactivated, reinstalled the latest versions, and activated them again. So, as a result, the mods we had in the plugins (which you previously said wouldn’t affect these issues anyway) have been removed.
Also, Ivy mentioned to Monica by email that the server does not support Cookies – I can assure you that is not the case. Cookies work just fine on the server, as do php sessions.
Now, the clues:
1. I get slightly different behaviour using Firefox 3.6.13 (the latest stable version I think). With that installed, I can get into the Affiliates area, however it still does not work quite right. If I log in using the main e-Member login page, I can then click on the Affiliates link and go right into the Affiliates area. However, if I log in using the Affiliates login page, I get logged in, then it redirects me to the site home page (then I can get into the affiliates area by clicking the affiliates link a 2nd time. This also works for me with latest stable version of Chrome (8.0.552.224). I am also on 64 bit Windows 7. And I have tested on a second machine (32 bit Win XP) – there when I had Firefox 3.6.3 installed, I has exactly the same behaviour as Monica explains. But after I upgraded to Firefox 3.6.13, it works as above. On that machine I have the dev build of Chrome (10.x), and that does not work. IE7 also tested on the WinXP machine – failed.
2. Hopefully this is more useful to you. When I tested with Firebug on the 3.6.3 version of Firefox, I got two javascript errors in the console from the Affiliate login page. These seem to suggest a coding error, not a user behaviour or server end problem:
jQuery(“.forgot_pass_link”).click(function (e) {jQuery(“#mailMsg”).html(“”).hide();jQuery(“#mailForm”).show();jQuery(“.eMember_text_input”).val(“”);}).overlay is not a function
[Break on this error] closeOnClick: false
$(“#lightbox a”).lightBox is not a function
[Break on this error] $(function() {$(‘#lightbox a’).lightBox();});
I hope this information helps you replicate and find the issues. If I can help at all, please let us know through this ticket. I’m happy to do whatever I can.
Thanks,
Kevin
January 6, 2011 at 11:37 am #27776HBin123Member… Further update:
I’m not so sure now about the Javascript errors being useful. I updated Firbug on the Win XP PC and the errors are still showing in Firebug console now, even though I am able to log in as described in the previous post.
We are happy to provide FTP login details, if that will help you isolate the issue.
Thanks,
Kevin
January 6, 2011 at 11:48 am #27777HBin123MemberOh, one other thing – Monica has confirmed that she and others have tested using Firefox 3.6.13 and it isn’t working for them.
So I suspect my clues may not be so much help after all.
Please let us know how to proceed. Thanks.
Kevin
January 6, 2011 at 1:07 pm #27778amin007ParticipantI checked your server and there definitely seems to be some PHP Session issue on this server.
Anyway, here is what you can do..
Open the “login.php” file from the “affiliates” directory of the plugin then look for the following code:
if(isset($_POST['remember']))
{
setcookie("user_id", $_SESSION['user_id'], time()+60*60*24*60, "/");
}Once you find it change it to the following (basically just comment out the if condition):
//if(isset($_POST['remember']))
{
setcookie("user_id", $_SESSION['user_id'], time()+60*60*24*60, "/");
}This should drop a cookie and use that to authenticate since the value set in the session is not retaining its value.
January 6, 2011 at 2:57 pm #27779HBin123MemberHi Amin,
Kevin changed this as you said, but we still have same problem
You have any more suggestions for us please ?
Best Regards
Monica
January 7, 2011 at 4:06 am #27780amin007ParticipantTry the following (since you are having issue with the PHP session its not going to have any value for the
$_SESSION['user_id']
):So change this line:
setcookie("user_id", $_SESSION['user_id'], time()+60*60*24*60, "/");
to the following:
setcookie("user_id", $userid, time()+60*60*24*60, "/");
January 7, 2011 at 10:49 am #27781HBin123MemberHi,
Kevin here.
The changes you suggested to login.php had no effect. So I experimented a bit by putting some echo statements in various places and found that logging in on the Affiliates section seems to be being processed in a different script to the one you mentioned (login.php).
I found it in wp_affiliate_platform1.php in the section:
if (isset($_POST))
I made similar changes there, removing the condition of:
// if(isset($_POST))
And that has fixed the first step of the problem – we can now log in in other browsers. Note that I did not replace $_SESSION with $userid in this case. $_SESSION is working.
The next step of the problem is after logging in it would redirect us to the home page. I have fixed this with a workaround as follows:
In the same section I have replaced:
$target_url= wp_aff_view_get_url_with_separator(“members_only”);
with:
$target_url = “http://homebusinessin123.com/?page_id=15”;
(i.e. a direct link to our affiliates section page)
That has solved the second problem. But a third issue still remains – maybe you have a suggestion on this.
When we login using the affiliate section login form it is now working in various browsers via the workarounds above. But if we log in using the main e-Member login page, it does not log us in the the affiliates section.
Do we need to manually add a setcookie somewhere in the eMember code perhaps? Or something similar?
Also if you can see a cause for the above issues it would be good to fix it properly because otherwise we will need to re-do these mods every time you release an upgrade to the scripts (if we wish to install the upgrade).
Any suggestions are welcomed. Thanks,
Kevin
January 8, 2011 at 3:41 am #27782amin007ParticipantSo you are using option 2 for the affiliate view/area explained here:
http://www.tipsandtricks-hq.com/wordpress-affiliate/setting-up-the-affiliate-viewarea-315
Option 1 is the default so unless you mention that you are using option 2, I assume that you are using option 1 so the code I gave you was for option 1.
Open the “wp_eMember1.php” file and look for the following code:
$_SESSION['user_id']= $_POST['login_user_name'];
if(isset($_POST['rememberme']))
{
setcookie("user_id", $_SESSION['user_id'], time()+60*60*24*7, "/");
}You will need to apply the same changes in the above code.
“Also if you can see a cause for the above issues it would be good to fix it properly” – I have already told you that the PHP session on your server is not working properly. Just because the $_SESSION variation is working on the same page does not mean its fully working. The $_SESSION variable is site wide and must retain the value when you go to a different page (in your case the $SESSION is losing value when the URL changes). It is the responsibility of a hosting provider to give the customer a properly setup server. You wouldn’t have to go through any of these if your server was setup properly from the beginning.
January 9, 2011 at 9:54 am #27783HBin123MemberHi,
Making the change you suggested to the wp_eMember1.php provides the workaround as you suggested, but I have tried confirming that sessions are not working on the server, but can not confirm that. This is a shared server, I work closely with the host and know that other sites on it use sessions successfully.
I also uploaded phpinfo() here: http://homebusinessin123.com/phpinfo.php
That shows everything looks good for sessions to me.
Also I have uploaded a pair of test files which write a value to a session variable then confirm it carries over to another page, which you can try here:
http://homebusinessin123.com/session_test.php
The file simply uses these codes to set the variable:
session_start ();
$_SESSION = “12345”;
Then gives a link to another page, which displays all present $_SESSION variables.
It seems to check out fine. So can you suggest anythign else here?
Thanks,
Kevin
-
AuthorPosts
- You must be logged in to reply to this topic.