1.

Which of the following function is used as a consequence of not including semicolons, Commas or whitespace in the Cookie value?(a) EncodeURIComponent()(b) EncodeURI()(c) EncodeComponent()(d) Encode()I have been asked this question in unit test.My question comes from Cookies topic in portion Networking of Computer Network

Answer»

Correct choice is (a) EncodeURIComponent()

For explanation: Cookie VALUES cannot include semicolons, COMMAS, or whitespace. For this reason, you may want to USE the core JAVASCRIPT global FUNCTION encodeURIComponent() to encode the value before storing it in the cookie.



Discussion

No Comment Found

Related InterviewSolutions