I have created front-end login form that allows users to login from front-end. However, when trying to access Admin section (dashboard), WP's default login form is displayed and user authorization is required.

$user_arr = array( 'user_login' => $u_name, 'user_password' => $u_pass, 'remember' => $u_remember );
$sign_user_on = wp_signon( $user_arr, true );

Any idea?


OK, I've got it! According to wp codex, second parameter of wp_signon() function refers to whether to use auth cookie or not. So if you use

wp_signon( $user_arr, false );

...re-auth will not be required.

  • If that fixes the problem, mark your own answer as accepted to close out the question. – Adam Oct 5 '12 at 5:39
  • I would but 1 day time frame is required. – Dameer Oct 5 '12 at 6:14

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.