• I’m currently using the Function/API calls to wordpress in order to get my custom login to work.

    I’m basically tying a regular php login, with the wordpress login. I’m using the following actions:

    $creds = array();
    $creds['user_login'] = $username;
    $creds['user_password'] = $password;
    $creds['remember'] = true;
    $user = wp_signon( $creds, false );
    wp_set_current_user($user->ID);

    This all seems to work well as just about all wp cookie settings are created:

    Array
    (
        [wp-settings-1] => editor=html&uploader=1&align=none&m1=o
        [wp-settings-time-1] => 1307032216
        [wp-settings-time-2] => 1307046336
        [wp-settings-2] => m3=o&m5=c&m1=c
        [wordpress_test_cookie] => WP Cookie check
    )

    Obviously there’s a bug somewhere as the full wordpress login looks like this:

    Array
    (
        [wp-settings-1] => editor=html&uploader=1&align=none&m1=o
        [wp-settings-time-1] => 1307032216
        [wp-settings-time-2] => 1307046336
        [wp-settings-2] => m3=o&m5=c&m1=c
        [wordpress_test_cookie] => WP Cookie check
        [wordpress_logged_in_1307046336asdadasdasdsadasdas] => my_user|1307046336|asdadasiodjasdiasjasdasdsa
    )

    The ‘wordpress_logged_in’ part is what allows the user to view the admin bar and not have to worry about logging in once again.

    My question is how do you get wordpress to correctly create a correct login session via the api/function reference?

    The above code should work per the documentations, but obviously doesn’t.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter TeckniX

    (@tecknix)

    No one uses a custom login and can help with this??

    Thread Starter TeckniX

    (@tecknix)

    Looking through some of the code and whatnot – Unless you call the above plugins from the directory of wordpress none of the cookies are setup correctly.
    Everything is hard-coded in wordpress yet it doesn’t do that.
    Same thing happens when you call logout.

    Defeats the purpose of the functions if you can only call them from within wordpress. Oh wait people only live with wordpress code!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WP Signon and set user via custom login SSO (Single-Sign-On)’ is closed to new replies.