Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wicket: block cookie usage until confirmed by user

Tags:

cookies

wicket

According to a European Union law, websites must not use cookies until confirmed by the user. How can we tell Wicket to not automatically use cookies until the user has confirmed it? Is there some add-on already available for that?

like image 976
Thomas S. Avatar asked Oct 19 '22 23:10

Thomas S.


2 Answers

You can use something like cookiecuttr and have wicket look for the cookie it sets before setting any of it's own.

like image 186
papkass Avatar answered Oct 28 '22 21:10

papkass


One can create an own Filter instance that is invoked before WicketFilter and pass a ServletResponse instance to the chain that prevents cookie creation:

chain.doFilter(req, new HttpServletResponseWrapper(response) {
    @Override
    public void addCookie(Cookie cookie) {
    }
});
like image 42
Thomas S. Avatar answered Oct 28 '22 23:10

Thomas S.