Skip to content

Commit

Permalink
Added "JRememberMe_" prefix
Browse files Browse the repository at this point in the history
Add a prefix ("JRememberMe_" in this case, can be anything else but it's best to standardize it) to the cookie name set by the "remember me" functionality for user logins in Joomla.

Using a prefix in that cookie name instead of just a hashed UA string (as it's currently done), we can use Joomla in conjunction with web caching proxies like Varnish without having the "remember me" functionality broken.
  • Loading branch information
fevangelou committed Aug 11, 2015
1 parent fedbfa0 commit a8451c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/system/remember/remember.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function onAfterInitialise()
// Check for a cookie if user is not logged in
if (JFactory::getUser()->get('guest'))
{
$cookieName = JUserHelper::getShortHashedUserAgent();
$cookieName = 'JRememberMe_'.JUserHelper::getShortHashedUserAgent();

// Check for the cookie
if ($this->app->input->cookie->get($cookieName))
Expand All @@ -77,7 +77,7 @@ public function onUserLogout($user, $options)
return true;
}

$cookieName = JUserHelper::getShortHashedUserAgent();
$cookieName = 'JRememberMe_'.JUserHelper::getShortHashedUserAgent();

// Check for the cookie
if ($this->app->input->cookie->get($cookieName))
Expand Down

0 comments on commit a8451c7

Please sign in to comment.