Leave a Reply

5 comments

  1. There are ways of doing it; this way, for instance. My guess is that Login With Ajax isn’t using all of the techniques described in that article, and some browser security feature is blocking it. Try getting in touch with the developer and suggesting improvements, with a pointer to that article.

  2. I’ve had a similar problem, and it turned out all depended on how the function wp_signon( $credentials, $secure_cookie ) was called.

    I want everything on my site to be https after signing on, so a non-secure cookie is of nu use.

    In my code from before ssl was: wp_signon( $credentials, false )

    so I changed:

    wp_signon( $credentials, false )
    

    to

    wp_signon( $credentials, true )
    

    Which creates a secure cookie and now everything’s fine.

    I can imagine that plugin developers try to rely on FORCE_SSL_ADMIN to set the secure cookie, try using
    wp_signon( $credentials, false ) in your case.
    I hope it solves the problem.

  3. Haven’t looked at the plugin, but my guess is it’s hard-coding the login URL without https in the Ajax request. The wp login form works fine in its non https version along with a form action that is set to use https, so I really can’t see why Ajax wouldn’t work.

    If changing the plugin is not an option, you could try these approaches:

    One would be some jquery goodness on the wp_footer hook. Search for the login form’s ID and change it’s URL, eg: $(ID).attr('action', newValue);

    (I’m not 100 it’ll work, though, as I vaguely recall jquery coughing on form tags when changing a form’s method or action.)

    A second approach, if the URL appears in the login form’s HTML but not in its Ajax call, would be to start an output buffer on wp_head, and str_replace() the URL.

    A third approach, if the actual url appears in the js script as a parameter, is to override it’s value in wp_footer, as is done in the auto-thickbox plugin for the image urls used in wp.

    A last option, if the script is messy spaghetti code with the login URL hard-coded within function calls, is to dequeue it using wp_dequeue_script(), and enqueue your own version to replace it. Mind priorities if you do this: your wp_print_scripts action should, obviously, occur after that of the plugin.