Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Unable to access cookies

    Hi,

    Highly appreciate if someone can point out why this is not working.

    On clicking a hyperlink, I am checking the username, roles & setting values in cookie inside a filter class.
    userCookie = new Cookie("username", userName);
    httpResponse.addCookie(userCookie);
    chain.doFilter(httpRequest, httpResponse);

    public class AdminMain implements EntryPoint {

    public void onModuleLoad() {
    String user = Cookies.getCookie("username");
    }}

    The user value is always coming in as null. In the filter class, proper value is being set.

    Is there any alternate way to receive the username?

    Thanks.
Working...
X