1. Documentation
  2. Daily Login Rewards
  3. WordPress login and cookies

WordPress login and cookies

From Daily Login Rewards v1.1.1 update, the instructions explained here are not required anymore because we added support to detect users that have been marked the option to “remember me” when log in.

Daily Login Rewards is strongly based on WordPress log in functionality (as GamiPress log in to website event). So, sometimes when you log in, WordPress is not really log in you, is just rescuing your session from a cookie.

What does this mean? This means that if you log out and log in quickly, you won’t get awarded (included with multiple log ins enabled) because WordPress is not really log in you.

Some ways to fix it

Changing auth cookie expiration

As explained in WordPress official documentation, the cookie expiration is set to 2 days and you can change it with a custom function like:

function my_prefix_auth_cookie_expiration( $expire ) {
    return DAY_IN_SECONDS; // 1 day
    // return HOUR_IN_SECONDS * 12; // 12 hours
add_filter ( 'auth_cookie_expiration', 'my_prefix_auth_cookie_expiration' );

If you are not familiarised with custom code, you can user a plugin like WP Login Timeout Settings to add visual settings to change it.

For test environment: Disable your browser cookies

If you are testing the add-on and you want a quick way to avoid issues with auth cookie expiration, you can disable cookies on your browser or if your browser has an utility to navigate without store cookies (like chrome’s incognito mode).

But keep in mind that disabling cookies does not solve the problem for users who access your site since they can have them activated, so just use this fix on test environment.

How can we help?