Codota Logo
Cookie.getMaxAge
Code IndexAdd Codota to your IDE (free)

How to use
getMaxAge
method
in
ro.polak.http.servlet.Cookie

Best Java code snippets using ro.polak.http.servlet.Cookie.getMaxAge (Showing top 3 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew LinkedList()
  • Codota IconCollections.emptyList()
  • Codota Iconnew ArrayList()
  • Smart code suggestions by Codota
}
origin: piotrpolak/android-http-server

    .append(StringUtilities.urlEncode(cookie.getValue()));
if (cookie.getMaxAge() != -1) {
  sb.append(SEPARATOR)
      .append("Expires")
      .append(EQUALS)
      .append(getExpires(cookie.getMaxAge()));
origin: piotrpolak/android-http-server

@Test
public void shouldWorkGettersAndSetters() {
  Cookie cookie = new Cookie("someName", "someValue");
  cookie.setComment("comment");
  cookie.setDomain("example.com");
  cookie.setPath("/somepath");
  cookie.setSecure(true);
  cookie.setHttpOnly(true);
  assertThat(cookie.getName(), is("someName"));
  assertThat(cookie.getValue(), is("someValue"));
  cookie.setValue("SomeValue2");
  assertThat(cookie.getValue(), is("SomeValue2"));
  assertThat(cookie.getComment(), is("comment"));
  assertThat(cookie.getDomain(), is("example.com"));
  assertThat(cookie.getPath(), is("/somepath"));
  assertThat(cookie.isSecure(), is(true));
  assertThat(cookie.isHttpOnly(), is(true));
  assertThat(cookie.getMaxAge(), is(-1));
  cookie.setMaxAge(125);
  assertThat(cookie.getMaxAge(), is(125));
}
origin: piotrpolak/android-http-server

@Test
public void shouldEraseCookieAndRemoveForInvalidatedSession() throws IOException {
  HttpSessionImpl session = new HttpSessionImpl("123", System.currentTimeMillis());
  session.invalidate();
  servletContext.handleSession(session, response);
  verify(sessionStorage, times(1)).removeSession(session);
  assertThat(response.getCookies().size(), is(greaterThan(0)));
  for (Cookie cookie : response.getCookies()) {
    if (cookie.getName().equals(HttpSessionImpl.COOKIE_NAME)) {
      assertThat(cookie.getMaxAge(), lessThan(-1));
      return;
    }
  }
  fail("Session DELETE cookie was not set.");
}
ro.polak.http.servletCookiegetMaxAge

Javadoc

Returns cookie max age in seconds.

Popular methods of Cookie

  • <init>
  • getComment
    Return cookie comment.
  • getDomain
    Returns cookie domain pattern.
  • getName
    Returns cookie name.
  • getPath
    Returns cookie path.
  • getValue
    Returns cookie value.
  • isHttpOnly
    Tells whether the cookie is http only.
  • isSecure
    Tells whether the cookie is secure.
  • setMaxAge
    Sets cookie max age in seconds. Set negative value less than -1 to remove cookie.
  • setValue
    Sets cookie value.
  • checkNameForIllegalCharacters
  • setComment
    Sets cookie comment.
  • checkNameForIllegalCharacters,
  • setComment,
  • setDomain,
  • setHttpOnly,
  • setPath,
  • setSecure

Popular in Java

  • Finding current android device location
  • getApplicationContext (Context)
  • compareTo (BigDecimal)
  • orElseThrow (Optional)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • Hashtable (java.util)
    Hashtable is a synchronized implementation of Map. All optional operations are supported.Neither key
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • JCheckBox (javax.swing)
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now