Fixing Login widget on WPLMS sites hosted on WPEngine.com

For sites hosted on WP Engine, we’ve found an issue with the Login panel. It seems to be repeatedly showing the error:

Data not Recieved
or
Cookies not set.

However, from version 1.5 there is a hook added in WPLMS using which this issue can be resolved easily:

0. Install the WPLMS Customizer plugin.
1. Go to WP Admin -> Plugins -> Editor -> WPLMS Customizer -> customizer_class.php
2. Add the following line of code in the function _construct

PHP Code:

add_filter('wplms_login_widget_action',array($this,'mycustom_login_url'));

3. Now add the following function at the end of the Class.

PHP Code:
function mycustom_login_url($login_url){
$login_url .='?wpe-login=mywpengineinstallname';
return $login_url;
}

Change mywpengineinstallname with your WP Engine name.

Gist : https://gist.github.com/MrVibe/1889ed763207ecf5d5c6