Skip to content

Instantly share code, notes, and snippets.

@authentical
Created October 1, 2018 07:11
Show Gist options
  • Save authentical/1d569f70fddd5d3fb44526d3d8f4852a to your computer and use it in GitHub Desktop.
Save authentical/1d569f70fddd5d3fb44526d3d8f4852a to your computer and use it in GitHub Desktop.
package demo;
import javax.servlet.http.Cookie;
/* This is just a Cookie implementation for doing some testing.
javax.servlet.http.Cookie with a default maxAge = 1 minute
*/
public class TempCookie extends Cookie{
// == Members ==
private int maxAge = 60;
// == Default Constructor with 60 second maxAge ==
public TempCookie(String name, String value){
super(name, value);
super.setMaxAge(maxAge);
}
// == Constructor supporting setting maxAge during instantiation ==
public TempCookie(String name, String value, int maxAge){
super(name, value);
super.setMaxAge(maxAge);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment