Adding Cookies in Java/Liferay
In Liferay , when user is logging into ,he/she can remember username . so that whenever user again tries to login no need to enter his crenditinals.
Following are things liferay is doing to add username in cookie in LoginUtil.java
Cookie loginCookie = new Cookie(CookieKeys.LOGIN, login);
if (Validator.isNotNull(domain)) { // Here domain is "www.liferay.com"
loginCookie.setDomain(domain);
}
loginCookie.setMaxAge(loginMaxAge); // Age of the Cookie
loginCookie.setPath(StringPool.SLASH);
CookieKeys.addCookie(request, response, loginCookie, secure);
Thanks for sharing this information. Since most of the students have lack o knowledge in how to organize a perfect essay during their academic life. So here you did a great job for the successful completion of their academic assignments.
ReplyDeletewhat is "secure" here in above code
ReplyDelete