Secure Storeadmin Area (SSL) (v. 2.81)

To use the storeadmin in a secure environment, you can specify that the cookie should only work when in SSL. Please note: this will be a stock option in version 2.82 and higher.

To add this on an earlier release, a secure certificate must first be installed on the server. Please contact your web host to purchase and install a secure certificate.

Once you have a secure certificate, do the following:

  1. Create an .htaccess file in the /storeadmin/ folder, and add the line:

    SSLRequireSSL

    This will throw out a 403 forbidden error if someone tries to log in to the storeadmin area through http:// instead of https://.

  2. Change the code:

    "/", "", 0);

    to:

    "/storeadmin/", "", 1);

    in all setcookie statements in the /storeadmin/ area. This will force the cookie to be used only in the /storeadmin/ directory, and enable it to be used only when in the https:// area. Please note that you will need to change 'storeadmin' to the actual directory you are using for the store admin area, and you will need to add a path if your site is using a subdirectory (e.g. www.mysite.com/shop/ will use "/shop/storeadmin").

    Here are the specific statements you'll need to change:

    1. Open the index.php file in the /storeadmin/ folder and change:

      setcookie ("adminusr", "", 0, "/", "", 0);
      setcookie ("adminpswd", "", 0, "/", "", 0);
      setcookie ("adminmstr", "", 0, "/", "", 0);

      to:

      setcookie ("adminusr", "", 0, "/storeadmin/", "", 1);
      setcookie ("adminpswd", "", 0, "/storeadmin/", "", 1);
      setcookie ("adminmstr", "", 0, "/storeadmin/", "", 1);
    2. Open the admncookie.php file in the /includes/ folder of the /storeadmin/ folder, and

      1. change:

        setcookie ("adminusr", "$adminusr", 0, "/", "", 0);

        to:

        setcookie ("adminusr", "$adminusr", 0, "/storeadmin/", "", 1);
      2. change:

        setcookie ("adminpswd", "$adminpswd", 0, "/", "", 0);

        to:

        setcookie ("adminpswd", "$adminpswd", 0, "/storeadmin/", "", 1);
      3. change:

        setcookie ("adminmstr", "$adminmstr", 0, "/", "", 0);

        to:

        setcookie ("adminmstr", "$adminmstr", 0, "/storeadmin/", "", 1);
      4. change:

        setcookie ("secpswd", $secpsd, 0, "/", "", 0);

        to:

        setcookie ("secpswd", $secpsd, 0, "/storeadmin/", "", 1);
    3. Open the pswdcookie.php file in the /includes/ folder of the /storeadmin/ folder, and

      1. change:

        setcookie ("adminpswd", $adminpswd, 0, "/", "", 0);

        to:

        setcookie ("adminpswd", $adminpswd, 0, "/storeadmin/", "", 1);
      2. change:

        setcookie ("secpswd", $secpsd, 0, "/", "", 0);

        to:

        setcookie ("secpswd", $secpsd, 0, "/storeadmin/", "", 1);
    4. Now make sure that your clients only use https:// when viewing their storeadmin area. In other words, if your client's site is www.someclientsite.com, the client will need to go to:

      https://www.someclientsite.com/storeadmin/

      to log in, instead of:

      http://www.someclientsite.com/storeadmin/