Skip to content

Commit

Permalink
#829 absolute path and expires
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Mar 13, 2018
1 parent fe45f96 commit ee17977
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/java/org/takes/facets/previous/RsPrevious.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -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()
)
);
}
Expand Down

0 comments on commit ee17977

Please sign in to comment.