View | Details | Raw Unified | Return to bug 44382
Collapse All | Expand All

(-)C:/Documents and Settings/Jim/workspace/tomcat-trunk/java/javax/servlet/http/Cookie.java (-2 / +40 lines)
Lines 87-92 Link Here
87
    private int maxAge = -1;	// ;Max-Age=VALUE ... cookies auto-expire
87
    private int maxAge = -1;	// ;Max-Age=VALUE ... cookies auto-expire
88
    private String path;	// ;Path=VALUE ... URLs that see the cookie
88
    private String path;	// ;Path=VALUE ... URLs that see the cookie
89
    private boolean secure;	// ;Secure ... e.g. use SSL
89
    private boolean secure;	// ;Secure ... e.g. use SSL
90
    private boolean httpOnly;	// ;HttpOnly ... e.g. block javascript access
90
    private int version = 0;	// ;Version=1 ... means RFC 2109++ style
91
    private int version = 0;	// ;Version=1 ... means RFC 2109++ style
91
    
92
    
92
    
93
    
Lines 336-341 Link Here
336
337
337
338
338
    /**
339
    /**
340
     * Indicates to the browser whether the cookie can be accessed
341
     * via Javascript
342
     * 
343
     * <p>The default value is <code>false</code>.
344
     *
345
     * @param flag	if <code>true</code>, sends the cookie with the HttpOnly flag
346
     *          preventing some browsers from accessing the cookie data via javascript
347
     *			if <code>false</code>, javascript has full access to cookie 
348
     *			data in all browsers
349
     *
350
     * @see #getHttpOnly
351
     *
352
     */
353
 
354
    public void setHttpOnly(boolean flag) {
355
	httpOnly = flag;
356
    }
357
358
359
360
361
    /**
362
     * Returns <code>true</code> if the cookie has the httpOnly flag set, 
363
     * 				or <code>false</code> if javascript has full access
364
     *              to cookie data
365
     *
366
     * @return	<code>true</code> if the cookie has httpOnly set;
367
     * 			 otherwise, <code>false</code>
368
     *
369
     * @see #setHttpOnly
370
     *
371
     */
372
373
    public boolean getHttpOnly() {
374
	return httpOnly;
375
    }
376
377
378
    /**
339
     * Indicates to the browser whether the cookie should only be sent
379
     * Indicates to the browser whether the cookie should only be sent
340
     * using a secure protocol, such as HTTPS or SSL.
380
     * using a secure protocol, such as HTTPS or SSL.
341
     *
381
     *
Lines 374-381 Link Here
374
414
375
415
376
416
377
378
379
    /**
417
    /**
380
     * Returns the name of the cookie. The name cannot be changed after
418
     * Returns the name of the cookie. The name cannot be changed after
381
     * creation.
419
     * creation.

Return to bug 44382