Zen Cart Logo
Forums / All Other Contributions/Addons / Is a Permanent Login (Auto-Login) Possible?

Is a Permanent Login (Auto-Login) Possible?

Views: 54,355

Results 121 to 140 of 219
17 Oct 2017, 12:58 PM
#121
solo_400 avatar

solo_400

Zen Follower

Join Date:
Aug 2009
Posts:
369
Plugin Contributions:
0

Is a Permanent Login (Auto-Login) Possible?

My live store address: http://bit.ly/1UEDgkc

PHP Version: 5.4.45

I had no problem to install / config. / adjust template of the module.

thx

17 Oct 2017, 2:22 PM
#122
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: Is a Permanent Login (Auto-Login) Possible?

@solo_400, I see the issue. Multiple cookies are being generated for each pseudo-subdirectory that is introduced by your URL mangler.

That is, on initial sign-in, the cookie is created for www.yoursite.com/shop. When I navigate to the bijuterii-din-argint/pandantive-de-argint/pandantiv-pentru-bratara-tip-charm-model-tip-murano-cod-387 product, a cookie is created for www.yoursite.com/shop/bijuterii-din-argint/pandantive-de-argint.

Let me investigate a bit further ...

20 Oct 2017, 3:34 PM
#123
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: Is a Permanent Login (Auto-Login) Possible?

Phew! You were quite correct @solo_400 ... the plugin did not work!

I've submitted v1.4.3 to the Zen Cart Plugins for review; it can be downloaded here (https://www.zen-cart.com/downloads.php?do=file&id=332) once reviewed.

       This release *drops support for Zen Cart versions prior to 1.5.5* and contains the changes associated with the following GitHub issues:

#4: Cart emptied on session timeout.
#5: Specify domain and path for cookie (interoperation with URL modifiers).
#6: Apply PSR-2 styling to plugin-specific files.
#7: Capture session values for restoration.
#8: Use Zen Cart 1.5.5e as the change-basis for template-override changes.

You can download this version from the plugin's GitHub repository (https://github.com/lat9/remember_me/releases/tag/v1.4.3) if you want a "preview". I'll update this thread when the plugin is available from Zen Cart.

21 Oct 2017, 2:57 PM
#124
solo_400 avatar

solo_400

Zen Follower

Join Date:
Aug 2009
Posts:
369
Plugin Contributions:
0

Re: Is a Permanent Login (Auto-Login) Possible?

Great lat9, I was waiting for a feedback :-)

  1. Can I install this new version without running remember_me_uninstall.sql ?
  2. tpl_login_default.php and tpl_modules_create_account.php are the same of 1.4.2 version ?

thank you

21 Oct 2017, 5:46 PM
#125
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: Is a Permanent Login (Auto-Login) Possible?

solo_400:

Great lat9, I was waiting for a feedback :-)

  1. Can I install this new version without running remember_me_uninstall.sql ?
  2. tpl_login_default.php and tpl_modules_create_account.php are the same of 1.4.2 version ?

thank you
You can upgrade without running the uninstall SQL, but the template-override files have changed from 1.4.2 to add changes introduced in Zen Cart 1.5.5e. If you have already installed (and possibly merged those files with your custom changes), you don't need to update those template files.

You can view the plugin's current readme here.

22 Oct 2017, 11:47 AM
#126
solo_400 avatar

solo_400

Zen Follower

Join Date:
Aug 2009
Posts:
369
Plugin Contributions:
0

Re: Is a Permanent Login (Auto-Login) Possible?

I have installed on my live store.

Is there any debug activated? I have a remember_me.log in log directory increasing fast.

22 Oct 2017, 11:55 AM
#127
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: Is a Permanent Login (Auto-Login) Possible?

solo_400:

I have installed on my live store.

Is there any debug activated? I have a remember_me.log in log directory increasing fast.
Darn it; I forgot to remove that debug code. Edit /includes/classes/observers/class.remember_me_observer.php, finding this section:

    
    protected function encodeCookie($cookie_data)
    {
        $cookie_data['currency'] = $_SESSION['currency'];
        $cookie_data['language'] = $_SESSION['language'];
        $cookie_data['languages_id'] = $_SESSION['languages_id'];
        $cookie_data['languages_code'] = $_SESSION['languages_code'];
        $cookie_data['cartIdSet'] = isset($_SESSION['cartID']);
        $cookie_data['securityToken'] = $_SESSION['securityToken'];
        error_log(date('Y-m-d H:i:s') . " encodeCookie: " . var_export($cookie_data, true) . PHP_EOL, 3, DIR_FS_LOGS . '/remember_me.log');
        
        return base64_encode(gzcompress(serialize($cookie_data), 9));
    }
    
    protected function removeCookie()
    {
        $this->setCookie('', time() - 3600);
    }
    
    protected function decodeCookie()
    {
        $remember_info = false;
        if (isset($_COOKIE[$this->cookie_name])) {
            $remember_info = base64_decode($_COOKIE[$this->cookie_name]);
            if ($remember_info !== false) {
                $remember_info = gzuncompress($remember_info);
                if ($remember_info !== false) {
                    $remember_info = unserialize($remember_info);
                }
            }
        }
        error_log(date('Y-m-d H:i:s') . " decodeCookie: " . var_export($remember_info, true) . PHP_EOL, 3, DIR_FS_LOGS . '/remember_me.log');
        return $remember_info;
    }

and commenting-out those debug lines:

    
    protected function encodeCookie($cookie_data)
    {
        $cookie_data['currency'] = $_SESSION['currency'];
        $cookie_data['language'] = $_SESSION['language'];
        $cookie_data['languages_id'] = $_SESSION['languages_id'];
        $cookie_data['languages_code'] = $_SESSION['languages_code'];
        $cookie_data['cartIdSet'] = isset($_SESSION['cartID']);
        $cookie_data['securityToken'] = $_SESSION['securityToken'];
[B]//[/B]        error_log(date('Y-m-d H:i:s') . " encodeCookie: " . var_export($cookie_data, true) . PHP_EOL, 3, DIR_FS_LOGS . '/remember_me.log');
        
        return base64_encode(gzcompress(serialize($cookie_data), 9));
    }
    
    protected function removeCookie()
    {
        $this->setCookie('', time() - 3600);
    }
    
    protected function decodeCookie()
    {
        $remember_info = false;
        if (isset($_COOKIE[$this->cookie_name])) {
            $remember_info = base64_decode($_COOKIE[$this->cookie_name]);
            if ($remember_info !== false) {
                $remember_info = gzuncompress($remember_info);
                if ($remember_info !== false) {
                    $remember_info = unserialize($remember_info);
                }
            }
        }
[B]//[/B]        error_log(date('Y-m-d H:i:s') . " decodeCookie: " . var_export($remember_info, true) . PHP_EOL, 3, DIR_FS_LOGS . '/remember_me.log');
        return $remember_info;
    }

I'll get an update going ...

22 Oct 2017, 12:04 PM
#128
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: Is a Permanent Login (Auto-Login) Possible?

FWIW, the update is now available on the plugin's GitHub repository: https://github.com/lat9/remember_me

I'll upload that to the Zen Cart plugins over the next couple of days.

22 Oct 2017, 12:08 PM
#129
solo_400 avatar

solo_400

Zen Follower

Join Date:
Aug 2009
Posts:
369
Plugin Contributions:
0

Re: Is a Permanent Login (Auto-Login) Possible?

ok done.

Now another one:

zcrm_ cokie is never removed, I can see it ( chrome ), there when I visit the store and I'm not logged and even when I logout. Is this normal ?

22 Oct 2017, 12:17 PM
#130
solo_400 avatar

solo_400

Zen Follower

Join Date:
Aug 2009
Posts:
369
Plugin Contributions:
0

Re: Is a Permanent Login (Auto-Login) Possible?

Something doesn't work. If I close the browser and open it after some minutes, ask for login :-(

22 Oct 2017, 12:28 PM
#131
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: Is a Permanent Login (Auto-Login) Possible?

solo_400:

ok done.

Now another one:

zcrm_ cokie is never removed, I can see it ( chrome ), there when I visit the store and I'm not logged and even when I logout. Is this normal ?

solo_400:

Something doesn't work. If I close the browser and open it after some minutes, ask for login :-(
I'll look at these later today.

22 Oct 2017, 4:38 PM
#132
davewest avatar

davewest

Totally Zenned

Join Date:
Dec 2007
Location:
Payson, AZ
Posts:
1,075
Plugin Contributions:
7

Re: Is a Permanent Login (Auto-Login) Possible?

Thanks for the update..

Working fine for me, added additional places for COWAA so its on login, register, create and no accounts. added a peek-a-boo instructions, but not getting FontAwesome icons to show, will have to play with that some more.

ZC1.5.5e
COWAA
PHP7.1
FireFox v56.0 on Ubuntu

Cookie does what the browsers settings are. Deletes on logoff, still there on browsers close/reopen. If browser is set to delete cookies on session end, it deletes the remember me cookie too. No added code to prevent non-account users from triggering it.

22 Oct 2017, 4:54 PM
#133
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: Is a Permanent Login (Auto-Login) Possible?

davewest:

Thanks for the update..

Working fine for me, added additional places for COWAA so its on login, register, create and no accounts. added a peek-a-boo instructions, but not getting FontAwesome icons to show, will have to play with that some more.

ZC1.5.5e
COWAA
PHP7.1
FireFox v56.0 on Ubuntu

Cookie does what the browsers settings are. Deletes on logoff, still there on browsers close/reopen. If browser is set to delete cookies on session end, it deletes the remember me cookie too. *** No added code to prevent non-account users from triggering it.***
Thanks back at you for giving it a whirl. What do you mean by the highlighted sentence?

22 Oct 2017, 5:51 PM
#134
davewest avatar

davewest

Totally Zenned

Join Date:
Dec 2007
Location:
Payson, AZ
Posts:
1,075
Plugin Contributions:
7

Re: Is a Permanent Login (Auto-Login) Possible?

lat9:

Thanks back at you for giving it a whirl. What do you mean by the highlighted sentence?

Tested to see if during non-account checkout if it could get triggered to save that account for auto log in.. Just a safety check, even non-account checkouts do create accounts.. and the no account page has a password field where I added the remember me checkbox.

22 Oct 2017, 7:21 PM
#135
solo_400 avatar

solo_400

Zen Follower

Join Date:
Aug 2009
Posts:
369
Plugin Contributions:
0

Re: Is a Permanent Login (Auto-Login) Possible?

On firefox and chrome in my ipad it seems ok till now. Hope problems i reported before, were because an old chrome version.

I have another question : why between browsers content cart is not syncronized? Products added to cart in a browser are not visible in cart when I check on other browser. Evident, always logged on.

23 Oct 2017, 1:06 PM
#136
solo_400 avatar

solo_400

Zen Follower

Join Date:
Aug 2009
Posts:
369
Plugin Contributions:
0

Re: Is a Permanent Login (Auto-Login) Possible?

@Lat9 - on Chrome is not working. I tried from 2 different pc, different chrome versions and s.o. After a while ( hours I think ) is asking for login again. Can you check please ?

23 Oct 2017, 2:57 PM
#137
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: Is a Permanent Login (Auto-Login) Possible?

solo_400:

@Lat9 - on Chrome is not working. I tried from 2 different pc, different chrome versions and s.o. After a while ( hours I think ) is asking for login again. Can you check please ?
It wouldn't be the first time that Chrome threw a wrench into the session-related handling. I've noted the request and will investigate later this week.

23 Oct 2017, 4:58 PM
#138
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: Is a Permanent Login (Auto-Login) Possible?

solo_400:

On firefox and chrome in my ipad it seems ok till now. Hope problems i reported before, were because an old chrome version.

I have another question : why between browsers content cart is not syncronized? Products added to cart in a browser are not visible in cart when I check on other browser. Evident, always logged on.
That's not within the realm of the plugin's processing. A cookie is set in the browser being used to access the site and used to manage that session, essentially keeping that specific session alive.

If you access the site using FireFox, then a cookie is created in the FireFox browser for that browser's use; if accessed via Chrome, then the cookie is going be created within Chrome's browser-history, available only Chrome's processing.

solo_400:

@Lat9 - on Chrome is not working. I tried from 2 different pc, different chrome versions and s.o. After a while ( hours I think ) is asking for login again. Can you check please ?
I've checked the basic handling, using Zen Cart 1.5.5e and the responsive_classic template, for Chrome and did not find any issue.

What I did was:

  1. Login, ticking the "Remember me?" box.
  2. Added a product to my cart.
  3. Went to checkout (sitting on the checkout_shipping page)
  4. Went away for a while, allowing the session to expire.
  5. Came back, clicked the "Continue" button and proceeded to Checkout/Payment.

If you'll provide a specific set of actions that you've taken to reproduce the issue, I can make more progress.

23 Oct 2017, 5:06 PM
#139
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: Is a Permanent Login (Auto-Login) Possible?

lat9:

Darn it; I forgot to remove that debug code. Edit /includes/classes/observers/class.remember_me_observer.php, finding this section:

protected function encodeCookie($cookie_data)
{
    $cookie_data['currency'] = $_SESSION['currency'];
    $cookie_data['language'] = $_SESSION['language'];
    $cookie_data['languages_id'] = $_SESSION['languages_id'];
    $cookie_data['languages_code'] = $_SESSION['languages_code'];
    $cookie_data['cartIdSet'] = isset($_SESSION['cartID']);
    $cookie_data['securityToken'] = $_SESSION['securityToken'];
    error_log(date('Y-m-d H:i:s') . " encodeCookie: " . var_export($cookie_data, true) . PHP_EOL, 3, DIR_FS_LOGS . '/remember_me.log');
    
    return base64_encode(gzcompress(serialize($cookie_data), 9));
}

protected function removeCookie()
{
    $this->setCookie('', time() - 3600);
}

protected function decodeCookie()
{
    $remember_info = false;
    if (isset($_COOKIE[$this->cookie_name])) {
        $remember_info = base64_decode($_COOKIE[$this->cookie_name]);
        if ($remember_info !== false) {
            $remember_info = gzuncompress($remember_info);
            if ($remember_info !== false) {
                $remember_info = unserialize($remember_info);
            }
        }
    }
    error_log(date('Y-m-d H:i:s') . " decodeCookie: " . var_export($remember_info, true) . PHP_EOL, 3, DIR_FS_LOGS . '/remember_me.log');
    return $remember_info;
}
> and commenting-out those debug lines:
> ```
    
    protected function encodeCookie($cookie_data)
    {
        $cookie_data['currency'] = $_SESSION['currency'];
        $cookie_data['language'] = $_SESSION['language'];
        $cookie_data['languages_id'] = $_SESSION['languages_id'];
        $cookie_data['languages_code'] = $_SESSION['languages_code'];
        $cookie_data['cartIdSet'] = isset($_SESSION['cartID']);
        $cookie_data['securityToken'] = $_SESSION['securityToken'];
[B]//[/B]        error_log(date('Y-m-d H:i:s') . " encodeCookie: " . var_export($cookie_data, true) . PHP_EOL, 3, DIR_FS_LOGS . '/remember_me.log');
        
        return base64_encode(gzcompress(serialize($cookie_data), 9));
    }
    
    protected function removeCookie()
    {
        $this->setCookie('', time() - 3600);
    }
    
    protected function decodeCookie()
    {
        $remember_info = false;
        if (isset($_COOKIE[$this->cookie_name])) {
            $remember_info = base64_decode($_COOKIE[$this->cookie_name]);
            if ($remember_info !== false) {
                $remember_info = gzuncompress($remember_info);
                if ($remember_info !== false) {
                    $remember_info = unserialize($remember_info);
                }
            }
        }
[B]//[/B]        error_log(date('Y-m-d H:i:s') . " decodeCookie: " . var_export($remember_info, true) . PHP_EOL, 3, DIR_FS_LOGS . '/remember_me.log');
        return $remember_info;
    }

I'll get an update going ...
v1.4.4 has been submitted to the plugins for review. I'll post back here once its available.

23 Oct 2017, 7:47 PM
#140
solo_400 avatar

solo_400

Zen Follower

Join Date:
Aug 2009
Posts:
369
Plugin Contributions:
0

Re: Is a Permanent Login (Auto-Login) Possible?

lat9:

I've checked the basic handling, using Zen Cart 1.5.5e and the responsive_classic template, for Chrome and did not find any issue.

What I did was:

  1. Login, ticking the "Remember me?" box.
  1. Added a product to my cart.
  1. Went to checkout (sitting on the checkout_shipping page)
  1. Went away for a while, allowing the session to expire.
  1. Came back, clicked the "Continue" button and proceeded to Checkout/Payment.

If you'll provide a specific set of actions that you've taken to reproduce the issue, I can make more progress.

Remember I gave you an account test on my live store? Can you do the same steps on my live store ?

I have Zen Cart 1.5.5, Database Patch Level: 1.5.5 ( not e ) Can you give me the changes 2 overwrite template files for version 1.5.5 please ?

thank you