congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
Cookie.getDomain
Code IndexAdd Tabnine to your IDE (free)

How to use
getDomain
method
in
org.pac4j.core.context.Cookie

Best Java code snippets using org.pac4j.core.context.Cookie.getDomain (Showing top 9 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew ArrayList()
  • Codota Iconnew LinkedList()
  • Smart code suggestions by Tabnine
}
origin: jooby-project/jooby

@Override
public void addResponseCookie(final Cookie cookie) {
 Definition c = new Definition(cookie.getName(), cookie.getValue());
 Optional.ofNullable(cookie.getDomain()).ifPresent(c::domain);
 Optional.ofNullable(cookie.getPath()).ifPresent(c::path);
 c.httpOnly(cookie.isHttpOnly());
 c.maxAge(cookie.getMaxAge());
 c.secure(cookie.isSecure());
 rsp.cookie(c);
}
origin: jooby-project/jooby

@Override public void addResponseCookie(Cookie cookie) {
 org.jooby.Cookie.Definition c = new org.jooby.Cookie.Definition(cookie.getName(),
   cookie.getValue());
 Optional.ofNullable(cookie.getDomain()).ifPresent(c::domain);
 Optional.ofNullable(cookie.getPath()).ifPresent(c::path);
 c.httpOnly(cookie.isHttpOnly());
 c.maxAge(cookie.getMaxAge());
 c.secure(cookie.isSecure());
 rsp.cookie(c);
}
origin: pippo-java/pippo

@Override
public void addResponseCookie(Cookie cookie) {
  getResponse().cookie(cookie.getPath(),
    cookie.getDomain(),
    cookie.getName(),
    cookie.getValue(),
    cookie.getMaxAge(),
    cookie.isSecure()
  );
  javax.servlet.http.Cookie addedCookie = getResponse().getCookie(cookie.getName());
  addedCookie.setHttpOnly(cookie.isHttpOnly());
  addedCookie.setComment(cookie.getComment());
}
origin: org.jooby/jooby-pac4j

@Override
public void addResponseCookie(final Cookie cookie) {
 Definition c = new Definition(cookie.getName(), cookie.getValue());
 Optional.ofNullable(cookie.getDomain()).ifPresent(c::domain);
 Optional.ofNullable(cookie.getPath()).ifPresent(c::path);
 c.httpOnly(cookie.isHttpOnly());
 c.maxAge(cookie.getMaxAge());
 c.secure(cookie.isSecure());
 rsp.cookie(c);
}
origin: io.ratpack/ratpack-pac4j

@Override
public void addResponseCookie(Cookie cookie) {
 final DefaultCookie newCookie = new DefaultCookie(cookie.getName(), cookie.getValue());
 newCookie.setDomain(cookie.getDomain());
 newCookie.setPath(cookie.getPath());
 if (cookie.getMaxAge() >= 0) {
  newCookie.setMaxAge(cookie.getMaxAge());
 }
 newCookie.setSecure(cookie.isSecure());
 newCookie.setHttpOnly(cookie.isHttpOnly());
 response.getCookies().add(newCookie);
}
origin: pac4j/jax-rs-pac4j

@Override
public void addResponseCookie(Cookie cookie) {
  CommonHelper.assertNotNull("cookie", cookie);
  // Note: expiry is not in servlet and is meant to be superseeded by
  // max-age, so we simply make it null
  NewCookie c = new NewCookie(cookie.getName(), cookie.getValue(), cookie.getPath(),
      cookie.getDomain(), cookie.getVersion(), cookie.getComment(), cookie.getMaxAge(), null,
      cookie.isSecure(), cookie.isHttpOnly());
  getAbortBuilder().cookie(c);
  getResponseHolder().addResponseCookie(c);
}
origin: pac4j/undertow-pac4j

@Override
public void addResponseCookie(final Cookie cookie) {
  final CookieImpl newCookie = new CookieImpl(cookie.getName(), cookie.getValue());
  newCookie.setComment(cookie.getComment());
  newCookie.setDomain(cookie.getDomain());
  newCookie.setPath(cookie.getPath());
  newCookie.setMaxAge(cookie.getMaxAge() < 0 ? null : cookie.getMaxAge());
  newCookie.setSecure(cookie.isSecure());
  newCookie.setHttpOnly(cookie.isHttpOnly());
  exchange.setResponseCookie(newCookie);
}
origin: pac4j/play-pac4j

@Override
public void addResponseCookie(final Cookie cookie) {
  final Http.CookieBuilder cookieBuilder =
      Http.Cookie.builder(cookie.getName(), cookie.getValue())
          .withPath(cookie.getPath())
          .withDomain(cookie.getDomain())
          .withSecure(cookie.isSecure())
          .withHttpOnly(cookie.isHttpOnly());
  // in Play, maxAge: Cookie duration in seconds (null for a transient cookie [value by default], 0 or less for one that expires now)
  // in pac4j, maxAge == -1 -> session cookie, 0 -> expires now, > 0, expires in x seconds
  final int maxAge = cookie.getMaxAge();
  if (maxAge != -1) {
    cookieBuilder.withMaxAge(Duration.of(maxAge, ChronoUnit.SECONDS));
  }
  final Http.Cookie responseCookie = cookieBuilder.build();
  response.setCookie(responseCookie);
}
origin: pac4j/play-pac4j

@Override
public void addResponseCookie(final Cookie cookie) {
  final Http.CookieBuilder cookieBuilder =
      Http.Cookie.builder(cookie.getName(), cookie.getValue())
          .withPath(cookie.getPath())
          .withDomain(cookie.getDomain())
          .withSecure(cookie.isSecure())
          .withHttpOnly(cookie.isHttpOnly());
  // in Play, maxAge: Cookie duration in seconds (null for a transient cookie [value by default], 0 or less for one that expires now)
  // in pac4j, maxAge == -1 -> session cookie, 0 -> expires now, > 0, expires in x seconds
  final int maxAge = cookie.getMaxAge();
  if (maxAge != -1) {
    cookieBuilder.withMaxAge(Duration.of(maxAge, ChronoUnit.SECONDS));
  }
  final Http.Cookie responseCookie = cookieBuilder.build();
  response.setCookie(responseCookie);
}
org.pac4j.core.contextCookiegetDomain

Popular methods of Cookie

  • <init>
  • getValue
  • getName
  • setDomain
  • setHttpOnly
  • setSecure
  • getMaxAge
  • getPath
  • isHttpOnly
  • isSecure
  • setPath
  • setMaxAge
  • setPath,
  • setMaxAge,
  • getComment,
  • setComment,
  • setVersion,
  • getVersion

Popular in Java

  • Parsing JSON documents to java classes using gson
  • addToBackStack (FragmentTransaction)
  • getApplicationContext (Context)
  • putExtra (Intent)
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Option (scala)
  • Top 17 Plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now