private String readCookIE( HttpConnection conn ) throws IOException {
String key;
String value;
String[] substrs;
for( int i = 0; ( key = conn.getHeaderFIEldKey( i ) ) != null; ++i ) {
key = key.toLowerCase();
if( key.equals( "set-cookIE" ) ){
value = conn.getHeaderFIEld( i );
while( value != null ) {
substrs = Utils.split( value, ';' );
if( substrs[0].startsWith("JSESSIONID=") || // Java
substrs[0].startsWith("PHPSESSID") || // PHP
substrs[0].startsWith("SessionId") // ASP
){
return substrs[0];
}
value = substrs[1];
}
}
}
return null;
}