By default, the user connection is automatically maintained 3 days. After that time, user has to reconnect.

You can use the wpak_auth_connection_expiration_time and wpak_auth_purge_time hooks to customize this expiration time in a .php file located in the php folder of your app’s theme.

Below an example that extends the connection to 365 days.

function wpak_custom_expiration_time( $expiration_time, $user_id, $app_id ) {
    $expiration_time = DAY_IN_SECONDS * 365;
    return $expiration_time;

add_filter( 'wpak_auth_connection_expiration_time', 'wpak_custom_expiration_time', 10, 3 );
add_filter( 'wpak_auth_purge_time', 'wpak_custom_expiration_time', 10, 3 );


Published by Benjamin on March 9, 2017

Head of Digital for a press group, WordPress since 2008, WordCamp organizer, developer for the fun


  1. Hola,

    estoy usando este código en el inicio de sesión del tema. Cuando dejo de utilizar la aplicación un par de días, la autenticación se cierra en automático y debo de volver a iniciar sesión.

    ¿Existe una forma de evitar esto?

    Gracias por su ayuda.

    • Hi Victor,
      This comment is in spanish, can you please re-post it in english?
      And anyway the best is that you write directly to our email support so that we can solve your problem.
      The thing is that we can’t reach you at the email you provided (mail delivery failure). Can you try with another email?
      Can you tell us exactly where you put the code of the tutorial (maybe send us the app theme that you are using so that we can check that the code is correct)?

  2. Hello Mathieu,
    I am using this code, but when they stop using the application for 5 days I log out atomically and I must log in again.
    Is there a way to avoid this?
    Thanks for your help.


Leave a Reply

Your email address will not be published. Required fields are marked *

Having questions?

FAQ | Tutorials | Documentation


Contact Us