In my jsp file I am setting a cookie I want to persist for a year. I have used the set max age and multiplied my seconds so it is a year. However the cookie only lasts for around 5mins. Even if I put in a ridiculously large value it still only lasts for ~5mins. 

I am testing on localhost could that have anything to do with it?

Code below:

```
    //value to check if the EU compliance cookie is present
boolean euCookiePresent = false;
//cookie parameters
String cookieName = "wtr_ca";
String cookieValue = "1";
int cookieExpiry = 365;

//cookie expiary is in seconds so convert to days
cookieExpiry = cookieExpiry * 60 * 60 * 24;

//Get clients cookies
Cookie cookies [] = request.getCookies ();

if (cookies != null){
    //iterate over users cookies to check for euCookie
    for (int i = 0; i < cookies.length; i++) 
    {
        if (cookies [i].getName().equals (cookieName)){
            euCookiePresent = true;
            break;
        }
    }

}

if (euCookiePresent == false){
    //no EU Cookie found therefore place it on client
    response.setContentType("text/html");
    Cookie cookie = new Cookie(cookieName,cookieValue);

    //cookie expiary is in seconds so convert to days
    cookie.setMaxAge(cookieExpiry);
    response.addCookie(cookie); 
}

```