![](https://wpdevkit.in/wp-content/themes/twentytwenty-child/imgs/post01.jpg)
How to set cookie in php?
![](https://wpdevkit.in/wp-content/themes/twentytwenty-child/li_st1.png)
![](https://wpdevkit.in/wp-content/themes/twentytwenty-child/li_st1.png)
![](https://wpdevkit.in/wp-content/themes/twentytwenty-child/li_st1.png)
![](https://wpdevkit.in/wp-content/themes/twentytwenty-child/imgs/kand5.png)
Set cookie in php
setcookie('otp', $otp, time()+62208000, '/', $_SERVER['HTTP_HOST']); //otp is the cookie name here
![](https://wpdevkit.in/wp-content/themes/twentytwenty-child/author.jpg)
POST COMMENTS
HOME / BLOG / BLOG-POST
How to set cookie in php?
setcookie('otp', $otp, time()+62208000, '/', $_SERVER['HTTP_HOST']); //otp is the cookie name here