Skip to content

Instantly share code, notes, and snippets.

<h2>test</h2>
<%
response.setHeader("Set-Cookie", "test=62CBD73375A66446766D698B3890BBB1; Path=/test; HttpOnly; Secure;");
response.setHeader("Set-Cookie", "none=62CBD73375A66446766D698B3890BBB1; Path=/test; HttpOnly; Secure; SameSite=none");
Cookie cookie = new Cookie("key","value");
response.addCookie(cookie);
Cookie[] cookies = request.getCookies();
for(int i = 0; i < cookies.length; i++){
out.print(cookies[i].getName() + " -> " + cookies[i].getValue());
out.println("</br>");
@jacktams
jacktams / gist:0e93f60004570a65dfb644cbaad40269
Created November 5, 2016 10:44
Configuring webdrivermanager
# Add this to a Maven project.
<dependency>
<groupId>io.github.bonigarcia</groupId>
<artifactId>webdrivermanager</artifactId>
<version>1.4.10</version>
</dependency>
# Add this to a Gradle project.
compile 'io.github.bonigarcia:webdrivermanager:1.4.10'
function fullBinaryString(input){
//coerce javascript to show full 32bit integer underneath.
return (input>>>0).toString(2);
}
function to8bitString(input){
//clamp the value to 8-bits by and with 0xFF
var clampedValue = (input&0xFF).toString(2);
//pad the string to make it easier to read.
return String("00000000" + clampedValue).slice(-8);
}