Php Objective Questions with Answers for written test exams 13

Question 13
If you set a cookie with either setcookie() or header(), you can immediately

check to see whether the client accepted it.

A. True, you can check the $_COOKIE superglobal array to see if it contains the

value you set.

B. True, but only if register_globals is enabled.

C. False, you can only use setcookie() if you need to test for acceptance.

Using header() does not work.

D. False, you must wait until you receive another HTTP request to determine

whether it includes the Cookie header.
Answers 13


Answer D is correct.The response that contains the Set-Cookie header is not sent

until PHP finishes executing, so you cannot test for acceptance prior to this.

Answers A and B are incorrect because the answer is false. Answer C is incorrect

because using setcookie() and header() both result in the same thing: A Set-

Cookie header is included in the response.

  







Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---