[jboss-user] [Tomcat, HTTPD, Servlets & JSP] - Can not save cookie data

quintenjiang do-not-reply at jboss.com
Wed Oct 11 17:59:23 EDT 2006


I have normal programming on cookie. It is fine to run under IIS. But it can only get Cookie value, and can not set Cookie ubder the Jboss. May i know if there are any configuration to support Cookie?

Thanks,

Quinten

JavaScript Code:

function getCookie(name) {
  var cookies = document.cookie;
  var start = cookies.indexOf(name + '=');
  if (start == -1) return null;
  var len = start + name.length + 1;
  var end = cookies.indexOf(';',len);
  if (end == -1) end = cookies.length;
  return unescape(cookies.substring(len,end));
}

function setCookie(name, value, expires, path, domain, secure) {
  value = escape(value);
  expires = (expires) ? ';expires=' + expires.toGMTString() :'';
  path    = (path)    ? ';path='    + path                  :'';
  domain  = (domain)  ? ';domain='  + domain                :'';
  secure  = (secure)  ? ';secure'                           :'';

  document.cookie =
    name + '=' + value + expires + path + domain + secure;
}


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3977711#3977711

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3977711



More information about the jboss-user mailing list