forked from Innovate-Inc/EDG_metadata
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_header.jsp
42 lines (35 loc) · 962 Bytes
/
test_header.jsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<%@ page import="javax.servlet.http.Cookie" %>
<%@ page import="java.util.Enumeration" %>
<%
out.println("<p>Cookies:");
Cookie[] cookies = request.getCookies();
if(cookies != null)
{
for (int i = 0; i < cookies.length; i++)
{
out.println("<br>Cookie " + i + " name: " + cookies[i].getName());
out.println("<br>value: " + cookies[i].getValue());
out.println("<br>domain: " + cookies[i].getDomain());
out.println("<br>path: " + cookies[i].getPath());
if(cookies[i].getName().equalsIgnoreCase("ObSSOCookie"))
{
cookies[i].setMaxAge(0);
cookies[i].setValue("");
response.addCookie(cookies[i]);
}
}
}
out.println("<p>Headers:");
Enumeration em = request.getHeaderNames();
if(em!=null)
{
int i = 0;
while (em.hasMoreElements())
{
String s = (String) em.nextElement();
out.println("<br>Header " + i + " name: " + s);
out.println("<br>value: " + request.getHeader(s));
++i;
}
}
%>