Login passes normally but customer is not logged in when back on home page

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 years ago
For some reasons, we have had to move our store on the web server (physically on the server and also in the logical structure inside IIS ... for having it on the 443 port). Since then it has remain impossible to login to the newly located site.

What happen is that the login passes ok: for example if the password is wrong, the login view show an error indicating the password in not correct, otherwise, when entering valid credentials everything goes fine (I have follow the code in CustomerController.Login() and watch roughly the content of variables and the code flows normally with apparent correct variable content until return RedirectToRoute("HomePage") in the CustomerLoginResults.Successful case.

Once back on the store home page (without any error message), there is no user logged in (the login hyperlink still appears instead of the user's identity/email in the top navigation menu).

How can that be and more important how can this condition be fixed?

Also, where is the code for the top navigation menu, I have been browsing the Views/Shared folder content but didn't find what I expected.

Thank you in advance for helping
Jean-Marc Gingras
7 years ago
Try to generate machine key. Read more here: http://www.codeproject.com/Articles/16645/ASP-NET-machineKey-Generator
7 years ago
Thank you for the answer.

Yes I already did something quite similar, the site has been moved alongside other ASP.Net MVC applications of ours and those all share same Machine Keys because some class of users can navigate from one to the other. They all use Form authentication with MS Entity.

So just to avoid confusion: before moving, Machine Keys for the nopCommerce where configured with AutoGenerate,IsolateApps. After moving I changed them to specific keys, those same used by our other applications.

I will try to generate new keys and let you know the result.

Best regards
Jean-Marc Gingras
7 years ago
I changed the Machine Keys for new ones and the behavior is still the same.

Would you know where to look for the code that display the top navigation menu (showing Login or User Id & Logout)? I thought I could drill down from this code and it could lead me find what/where something is wrong/missing.

Thank you for your help.

Best regards
Jean-Marc Gingras
7 years ago
[email protected] wrote:
I changed the Machine Keys for new ones and the behavior is still the same.

Would you know where to look for the code that display the top navigation menu (showing Login or User Id & Logout)? I thought I could drill down from this code and it could lead me find what/where something is wrong/missing.

Thank you for your help.

Best regards
Jean-Marc Gingras


This menu is here: Views\Common\HeaderLinks.cshtml
7 years ago
After some tests I appears that login doesn't find the customer. The lookup happens in the CustomerService.GetCustomerBy... function which uses the _customerRepository member of the same class.

It is not clear for me where this repository comes from at instance creation (possibly the result of some dependency injection component). I know for sure that the store itself is connected with the right instance of database because categories and products are correct so there might be some specific connection for authentication database.

Does this make sense? If so, where/how would this connection be specified in configuration, how can I find more about it?

Thank you for helping
Best regards
Jean-Marc Gingras
6 years ago
Was a solution found for this?  We have seen a similar issue on self hosted web servers and to fix one as a test we redeployed the server and had no issues, everything worked.

Please let me know.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.