Support » Fixing WordPress » how to setcookie in wp for custom login

  • Resolved capxxx


    I make a custom login form on my front blog page where me and my user author can key in username and password and it will log them in. When user click login, it will check for match from my wordpress database user table and if it match i setcookie and redirect them to wp-login.php. But it didnt work. The wp-login.php form will show up instead of go into admin panel. I use this code to setcookie–>
    setcookie(‘wordpressuser_’ . COOKIEHASH, $username,time() + 31536000,$cookiepath);
    setcookie(‘wordpresspass_’ . COOKIEHASH, $password,time() + 31536000,$cookiepath);

    where $username and $password is what the people key in.
    Can someone please help me!!
    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • skippy



    Check in /wp-includes/pluggable-functions.php for the wp_setcookie() funciton, for the specific cookie contents.

    Thank you very much!! it works, what i did was just add the value for cookiehash and cookiepath to what i wish for according to the wp_setcookie() function in pluggable-functions.php

    again thanks!!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘how to setcookie in wp for custom login’ is closed to new replies.