GSEC · Question #191
Which of the following languages enable programmers to store cookies on client computers? Each correct answer represents a complete solution. Choose two.
The correct answer is B. Perl D. JavaScript. Both Perl and JavaScript provide built-in mechanisms to create and send cookies that are stored on the client's computer.
Question
Which of the following languages enable programmers to store cookies on client computers? Each correct answer represents a complete solution. Choose two.
Options
- ADHTML
- BPerl
- CHTML
- DJavaScript
How the community answered
(27 responses)- A7% (2)
- B81% (22)
- C11% (3)
Why each option
Both Perl and JavaScript provide built-in mechanisms to create and send cookies that are stored on the client's computer.
DHTML (Dynamic HTML) is a combination of HTML, CSS, and scripting technologies - not an independent language - and has no native cookie API of its own.
Perl is a server-side scripting language that can set cookies by writing Set-Cookie HTTP response headers using modules such as CGI.pm, causing the browser to store the cookie on the client machine.
HTML is a static markup language with no scripting or programming capability and cannot programmatically create or store cookies on a client computer.
JavaScript is a client-side scripting language that can directly read and write cookies on the client computer through the document.cookie API without requiring a round-trip to the server.
Concept tested: Server-side and client-side cookie storage languages
Source: https://developer.mozilla.org/en-US/docs/Web/API/Document/cookie
Topics
Community Discussion
No community discussion yet for this question.