2

Recently we moved a site to SSL following popular guidelines.

Everything worked as expected except when it comes to uploading images via the frontend.

Trying to upload an image we get the following response:

302 POST async-ajax.php 200 GET https://example.com/wp-login.php?redirect_to=https://example.com/wp-admin/async-upload.php&reauth=1

So image upload fails, cookie is invalidated (reauth=1), user is forced to login again.

Other observations:

  1. Users are able to upload images via backend
  2. There is no errors in wp-debug
  3. It works fine if we revert to non-ssl

1 Answer 1

4

If you are using custom front-end registration through wp_signon function, check, if the second parameter, passed to that function is true:

$user_signon = wp_signon( $info, true ); ).

The second parameter tells WordPress to set the secure cookie for login. It works fine with SSL.

1
  • Awesome, Thank You. Commented Aug 23, 2023 at 5:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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