How to set cookies in PHP?

I want to set cookies for 1day in php web application

Team Leader Asked on February 11, 2017 in PHP.
Add Comment
1 Answer(s)
    
    <?php
    
    $cookieName = "USERNAME";
    
    $cookieValue = "Bikash";
    
    setcookie($cookieName, $cookieValue, time() + (86400 * 30), "/"); // 86400 = 1 day
    
    ?>
    
    
    Team Leader Answered on March 19, 2017.
    Add Comment

    Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.