HttpCookie HasExpired() Example

Reports whether this http cookie has expired or not.


HttpCookieclass HasExpired() method example. This example shows you how to use HasExpired() method.This method Reports whether this http cookie has expired or not.

Here is the code:-
/* 
 * @Program that Reports whether this http cookie has expired or not.
 * HasExpired.java 
 * Author:-RoseIndia Team
 * Date:-25-Jun-2008
 */

import java.net.*;

public class HasExpired {
 public static void main(String[] argsthrows Exception {
        String name = "Roseindia";
        String value = "ABC";
        HttpCookie hc = new HttpCookie(name, value);
        //Reports whether this http cookie has expired or not.
         System.out.println("Cookie has expired : "+hc.hasExpired());
    }
}

Output of the program:-
 Cookie has expired : false

Post Comment
Name:
E-mail:
Contact no :
Comments:
  Refresh Image
Verify Image:
 
 
Your Comment's
 
 
 

HOME | COPYRIGHT | CONTACT US