Keep users logged in

Is there a way to keep users logged in? I´m currently using one plugin that keeps “remember me” box checked by default and another one that sets timeout time to 365 days. The problem is that the first plugin makes the box checked only on the wordpress login page but not in the s2member login form. So users that use s2member form to log in almost always forget to check “remember me” and get logged out when they close the browser.

Is there a simple way to keep them logged in longer? it´s extremely annoying to type the passwords every time

It sounds like you just need a couple of lines of javascript to do the trick. Can you point me towards the login form? And does your (child) theme have a javascript file that the code can be added to.

Hi,

Thanks for the quick reply!

Here is the wp login page www.newsinslowrussian.org/wp-login.php?registration=disabled
Here is a blog post with an s2member login form http://www.newsinslowrussian.org/russian-podcast-february-19/

Yes, I can add the code to my theme. Could you give me the code?

Try this:

$('.ws-plugin--s2member-pro-login-widget').find('input[type="checkbox"]').prop('checked',true).attr('aria-checked',true);

I did. Unfortunately, it didn´t change anything

Where have you put that code?

You could also try this simplified version:

$('.ws-plugin--s2member-pro-login-widget').find('input').prop('checked',true).attr('aria-checked',true);

Or you can try a different variation:

$('.ws-plugin--s2member-pro-login-widget').find('input').attr('checked',true).attr('aria-checked',true);

Neither worked. My theme has a section for custom code. I put the one you gave me to the javascript section. Am i missing something?

Does that section begin with this line?

jQuery(document).ready(function($) {  

If not, my code almost certainly won’t work.