diff --git a/src/main/java/org/takes/facets/previous/RsPrevious.java b/src/main/java/org/takes/facets/previous/RsPrevious.java index dfad425e6..8eeb2b90d 100644 --- a/src/main/java/org/takes/facets/previous/RsPrevious.java +++ b/src/main/java/org/takes/facets/previous/RsPrevious.java @@ -25,10 +25,12 @@ import java.io.UnsupportedEncodingException; import java.net.URLEncoder; +import java.util.concurrent.TimeUnit; import lombok.EqualsAndHashCode; import lombok.ToString; import org.takes.Response; import org.takes.facets.cookies.RsWithCookie; +import org.takes.misc.ExpirationDate; import org.takes.rs.RsWrap; /** @@ -56,7 +58,11 @@ public RsPrevious(final Response rsp, final String location) new RsWithCookie( rsp, TkPrevious.class.getSimpleName(), - URLEncoder.encode(location, "UTF-8") + URLEncoder.encode(location, "UTF-8"), + "Path=/", + new ExpirationDate( + System.currentTimeMillis() + TimeUnit.HOURS.toMillis(1L) + ).toString() ) ); }