public class CookieSanitizerSecurityAdapter extends Object implements SecurityAdapter<javax.servlet.http.Cookie>
REGEX_PROP_FILE| Constructor and Description |
|---|
CookieSanitizerSecurityAdapter() |
| Modifier and Type | Method and Description |
|---|---|
Data<javax.servlet.http.Cookie> |
sanitize(Data<javax.servlet.http.Cookie> data)
Returns the same cookie as the input
Note: HTTP Only is controlled at the response header like response.setHeader( "Set-Cookie", "name=value; HttpOnly")
or at a server level in Tomcat 6 flag useHttpOnly=True in context.xml to force this behaviour for applications
For session cookie, we can set in web.xml:
|
void |
validate(Data<javax.servlet.http.Cookie> input)
Check if the input is safe or not
When used in a chained or a SecurityContext with other SecurityAdapters then the Adapters throwing
a OperationNotSupportedException will be ignored. |
public Data<javax.servlet.http.Cookie> sanitize(Data<javax.servlet.http.Cookie> data) throws Exception, OperationNotSupportedException
<session-config> <cookie-config> <http-only>true</http-only> </cookie-config> <session-config>
sanitize in interface SecurityAdapter<javax.servlet.http.Cookie>ExceptionOperationNotSupportedExceptionpublic final void validate(Data<javax.servlet.http.Cookie> input) throws SecurityException, OperationNotSupportedException, IOException
SecurityAdapterSecurityContext with other SecurityAdapters then the Adapters throwing
a OperationNotSupportedException will be ignored.validate in interface SecurityAdapter<javax.servlet.http.Cookie>input - as DataSecurityException - is its is not safe. This is to provide additional details about the failure that te return param cannot.IOException - for any type of setup, reading, infra related issue with files/configsOperationNotSupportedExceptionCopyright © 2018. All rights reserved.