I have uncovered a few more simple issues with the CookieManager which have been 
causing me some grief:

The method CookieManager.getCookieFromHeader(String, URL) will use the URL properties 
to set the domain and path information for the cookie, rather than the information 
encapsulated within the cookie itself. 


        String domain = url.getHost();  //still use original code for defaults - is 
this required ?
        String path = url.getFile();

        // NEW CODE STARTS HERE//
        String tokName;

        //we have made some assumptions up above which may not prove correct...
        while (st.hasMoreTokens()) 
        {
                nvp = st.nextToken();
                delim = nvp.indexOf('=',0);
                tokName = nvp.substring(0, delim).trim();  

                //unfortunately we cannot make any assumptions concerning the order of 
the attributes...
                if (tokName.equalsIgnoreCase("domain")) 
                {
                        domain = nvp.substring(delim+1);
                } 
                else if (tokName.equalsIgnoreCase("path")) 
                {
                        path = nvp.substring(delim+1);
                }
        }
        //NEW CODE ENDS HERE//



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to