Knowledge Base Nr: 00339 gwtcookies.java - http://www.swe-kaiser.de

Downloads:

GWT:handle cookies

  
//setzen
Cookies.setCookie("company", m_strCompany);
Cookies.setCookie("username", m_strUsername);
Cookies.setCookie("password", m_strPassword);
//auslesen
m_loginform.m_strCompany = Cookies.getCookie("company");
m_loginform.m_strUsername = Cookies.getCookie("username");
m_loginform.m_strPassword = Cookies.getCookie("password");

//if null, there was no cookie
if (m_loginform.m_strCompany == null) m_loginform.m_strCompany = "";
if (m_loginform.m_strUsername == null) m_loginform.m_strUsername = "";
if (m_loginform.m_strPassword == null) m_loginform.m_strPassword = "";