You can use methods in HttpServletRequest class.
For example:
host = request.getRemoteHost();
if (host == null)
host = request.getRemoteAddr();
You need to check to see if it starts with www or not. You may have other subdomains like abc.ourwebsite.com. So you need to parse the URL to get the ".ourwebsite.com" and set it in the cookie.
~Jay
JavaRSS.com,
Java News,
Java Articles and
Java Blogs, Just one Bookmark.