本文整理了Java中ro.pippo.core.Response.cookie
方法的一些代码示例,展示了Response.cookie
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Response.cookie
方法的具体详情如下:
包路径:ro.pippo.core.Response
类名称:Response
方法名:cookie
[英]Adds a cookie to the response.
[中]向响应中添加cookie。
代码示例来源:origin: stackoverflow.com
Connection.Response res = Jsoup.connect("http://www.example.com/login.php")
.data("username", "myUsername", "password", "myPassword")
.method(Method.POST)
.execute();
Document doc = res.parse();
String sessionId = res.cookie("SESSIONID"); // you will need to check what the right cookie name is
代码示例来源:origin: pippo-java/pippo
/**
* Sets the application language cookie.
* <p>
* If the language does not match a registered language or language
* component an exception is thrown.
* </p>
*
* @param language
* @param routeContext
* @throws PippoRuntimeException
*/
public void setLanguageCookie(String language, RouteContext routeContext) {
String lang = getLanguageOrDefault(language);
if (lang.equals(language)) {
Cookie cookie = generateLanguageCookie(language);
routeContext.getResponse().cookie(cookie);
} else {
throw new PippoRuntimeException("'{}' is not a registered language!", language);
}
}
代码示例来源:origin: stackoverflow.com
Connection.Response res = Jsoup.connect(url).method(Connection.Method.GET)
.timeout(50000).execute();
this.sessionIdCookie = res.cookie("session_id");
this.loginCookie = res.cookie("login");
代码示例来源: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: stackoverflow.com
Connection.Response res = Jsoup.connect("http://www.cybernations.net/login.asp")
.data("Username", "myUsername", "Validate_Password", "myPassword")
.method(Method.POST)
.execute();
Document doc = res.parse();
String sessionId = res.cookie("ASPSESSIONIDAAACSTQB");
代码示例来源:origin: stackoverflow.com
Connection.Response res = Jsoup.connect(loginUrl).execute();
String sessionId = res.cookie("sessionId");
Document doc = res.parse();
代码示例来源:origin: gitblit/fathom
c.setHttpOnly(true);
c.setMaxAge(-1);
context.getResponse().cookie(c);
cookie.setHttpOnly(true);
cookie.setMaxAge((int) TimeUnit.DAYS.toSeconds(365));
context.getResponse().cookie(cookie);
代码示例来源:origin: com.gitblit.fathom/fathom-rest-security
c.setHttpOnly(true);
c.setMaxAge(-1);
context.getResponse().cookie(c);
cookie.setHttpOnly(true);
cookie.setMaxAge((int) TimeUnit.DAYS.toSeconds(365));
context.getResponse().cookie(cookie);
内容来源于网络,如有侵权,请联系作者删除!