public synchronized void setCookie (String key, String value, int days) { if (nCookies == 0) { cookieKeys = new String [3]; cookieValues = new String [3]; cookieDays = new int [3]; } if (nCookies == cookieKeys.length) { String nk[] = new String [nCookies+3]; System.arraycopy (cookieKeys, 0, nk, 0, nCookies); String nv[] = new String [nCookies+3]; System.arraycopy (cookieValues, 0, nv, 0, nCookies); int nd[] = new int [nCookies+3]; System.arraycopy (cookieDays, 0, nd, 0, nCookies); cookieKeys = nk; cookieValues = nv; cookieDays = nd; } cookieKeys [nCookies] = key; cookieValues [nCookies] = value; cookieDays [nCookies] = days; nCookies += 1;
public synchronized void setCookie (String key, String value) { setCookie (key, value, -1);
    public synchronized void setCookie (String key, String value, int days) {	if (nCookies == 0) {	    cookieKeys = new String [3];	    cookieValues = new String [3];	    cookieDays = new int [3];	}	if (nCookies == cookieKeys.length) {	    String nk[] = new String [nCookies+3];	    System.arraycopy (cookieKeys, 0, nk, 0, nCookies);	    String nv[] = new String [nCookies+3];	    System.arraycopy (cookieValues, 0, nv, 0, nCookies);	    int nd[] = new int [nCookies+3];	    System.arraycopy (cookieDays, 0, nd, 0, nCookies);	    cookieKeys = nk;	    cookieValues = nv;	    cookieDays = nd;	}	cookieKeys [nCookies] = key;	cookieValues [nCookies] = value;	cookieDays [nCookies] = days;	nCookies += 1;    }