[resolved] how to setcookie in wp for custom login (3 posts)

  1. capxxx
    Posted 10 years ago #

    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.

  2. skippy
    Posted 10 years ago #

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

  3. capxxx
    Posted 10 years ago #

    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!!

Topic Closed

This topic has been closed to new replies.

About this Topic