Cookie() method will take 3 arguments. 3 arguments. First argument is the name of the cookie, second argument is the value of the cookie and the third argument is the duration of the cookie after which the cookie will get deleted automatically.
To use cookies on PHP immediatly (without waiting a refresh): Setcookie and set global cookie.