Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2008
    Posts
    164
    Plugin Contributions
    0

    Default Admin Login Not Working - Cross-Origin Domain Issue

    Problem and a solution here - hope this helps someone else out as it wasn't intuitive at all and could easily cause hours of troubleshooting for someone who isn't familiar with it.

    Fresh install of ZC, left default
    Code:
    define('HTTP_SERVER','http://www.mydomain.com');
    during installation but once I copied over the .htaccess settings from another domain, the admin stopped logging in. No error message, was also unable to reset the password.

    I went to test the storefront and upon heading to the login page, the ajax script threw a cross-origin domain error on the login page. Looking at the FireFox console I saw:
    Code:
    Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://www.mystore.com/ajax.php?act=ajaxPayment&method=setNoscriptCookie. This can be fixed by moving the resource to the same domain or enabling CORS.
    It finally clicked that "www.mystore.com" and "mystore.com" are "separate" domains and that I had a conflicting configuration.

    Problem: .htaccess re-directs to non-www version while the configure.php is set for www-version (or vice-versa).

    Solution: Either update configure.php or .htaccess so they both use either www or non-www.

    Suggestion to ZenCart team: Detect if there's a redirect/configuration mis-match, there was no error or indication that this may be a problem. Previous versions of ZenCart (151 was my last fresh install) didn't create this problem for me.

    Search Engine Keywords: new install v154 zen-cart admin log in failure password reset fail
    An unknown response null: :null: :[Exception... "Failure" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: http://code.jquery.com/jquery-1.11.1.min.js :: .send :: line 4" data: no] was received while processing an ajax call. The action you requested could not be completed.

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Admin Login Not Working - Cross-Origin Domain Issue

    MODERATOR NOTE:
    The posts for the non-admin discussion have been moved to: https://www.zen-cart.com/showthread....g-an-ajax-call
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. Origin of Country for Shipping not working
    By branicdesigns in forum General Questions
    Replies: 23
    Last Post: 22 Dec 2015, 03:00 PM
  2. Admin login not working
    By gireesh in forum General Questions
    Replies: 1
    Last Post: 2 Jun 2008, 10:04 PM
  3. Admin login not working.
    By swatoffroad in forum Basic Configuration
    Replies: 25
    Last Post: 10 Jul 2007, 08:06 AM
  4. Customer Login and Admin Login not working
    By trudesign in forum General Questions
    Replies: 4
    Last Post: 6 Jun 2007, 04:26 AM
  5. Admin login not working!
    By ccn1 in forum General Questions
    Replies: 3
    Last Post: 19 Feb 2007, 04:23 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR