Is it possible to change the expiration time of the logged in cookie? Right now I have to login again from time to time. But I want to extend this time to be much longer, maybe infinite.

The thing is I have created pages on the frontend that requires you to be logged in, and I don't want the user to have to login again.

Is it possible to set the login expiration for frontend to never expire? Or maybe both?


Since Wordpress 2.8 a filter is provided to set the cookie expiration .

apply_filters( 'auth_cookie_expiration', int $length, int $user_id, bool $remember )

More details here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.