• Resolved emoncht

    (@emoncht)


    I am using your Nextend Social Login plugin on my WordPress website and it has been working splendidly. Recently, I have come across a requirement to adjust the cookie expiration time for users logging in through the social login feature. I’ve gone through the documentation but couldn’t find any relevant information regarding this.

    I am aware that WordPress provides a hook auth_cookie_expiration which can be used to alter the cookie expiration time, however, I am not sure if this would work seamlessly with your plugin or if there’s a specific hook provided by Nextend Social Login for this purpose. I tried with this hook but Didn’t succeed. I’ve increased the deafault time of cookie with a sepetate plugin. But that plugin is not increasing the cookie expiration time for YOUR PLUG-IN.

    Could you please advise if there is a specific hook or a method within the Nextend Social Login plugin to change the cookie expiration time? Your guidance on this would be immensely helpful for configuring the plugin to meet our site’s requirements.

Viewing 1 replies (of 1 total)
  • Plugin Support Laszlo

    (@laszloszalvak)

    Hi @emoncht

    The filter that you found should work for Nextend Social Login, too as we set the auth cookie the WordPress way, using the wp_set_auth_cookie() function:

    Just in case I checked it on my local test site with a filter like this:

    add_filter ( 'auth_cookie_expiration', function($length){
        return YEAR_IN_SECONDS;
    });

    and it worked fine for me.

    If it didn’t work for you, then I find it possible that you either:

    • added the filter at the wrong place, so your custom function is not actually hooked. If this is the case, you should try it e.g. in the functions.php file of your child theme.
    • or you already have another function hooked to the auth_cookie_expiration filter, maybe with a greater priority. So that is being used. If this is the case, then you should try hooking your function with a priority great enough.

    Best regards,
    Laszlo.

Viewing 1 replies (of 1 total)
  • The topic ‘Edit/Modify Cookie expiration time’ is closed to new replies.