下列选项中,用于获取客户端发给服务端的所有cookie对象的方法是( )
A: List cookies = request.getCookies();
B: Cookie[] cookies = request.getCookies();
C: List cookies = response.getCookies();
D: Cookie[] cookies = response.getCookies();
A: List cookies = request.getCookies();
B: Cookie[] cookies = request.getCookies();
C: List cookies = response.getCookies();
D: Cookie[] cookies = response.getCookies();
举一反三
- PHP用于存储cookie数据的超级全局变量是( A: $_COOKIES B: $_GETCOOKIES C: $_GETCOOKIE D: $_COOKIE
- 读取客户端存储的Cookie,以下操作正确的是( )。 A: Cookie newCookie=new Cookie(String key,Object value); B: response.addCookie(newCookie); C: Cookie[] cookies=response.getCookies(); D: Cookie[] cookies=request.getCookies();
- 在PHP中用于存储cookie数据的超级全局变量是() A: $_COOKIES B: $_COOKIE C: $_GETCOOKIES D: $_GETCOOKIE
- 以下哪段代码能从请求对象中获取名为"ORA-UID"的Cookie的值? ( ) A: String value = request. getCookie("ORA-UID"); B: String value = request.getHeader("ORA-UID"); C: Cookie[] cookies = request.getCookies();String cName= null;String value = null;if( cookies !=null){for(int i = 0 ;i<;cookies.length; i++){ cName = cookie[i].getName(;if(cName!=null &&. cName.equalsIgnoreCase("ORA-UID")){value = cookies[i].getValue();} D: Cookie[] cookies = request.getCookies();if(cookies. length>;0){String value = cookies[0].getValue();}
- 写入Cookie对象,通过响应将Cookie写入客户端以下正确的是( )。 A: Cookie newCookie=new Cookie(String key,Object value); B: response.addCookie(newCookie); C: Cookie[] cookies=request.getCookies(); D: request.addCookie(newCookie);