Skip to content
This repository was archived by the owner on Jul 31, 2022. It is now read-only.

Commit 4336cf2

Browse files
committed
Bug fixes
1 parent f322440 commit 4336cf2

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/main/java/com/kttdevelopment/simplehttpserver/SimpleHttpCookie.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ public final String toString(){
111111
*/
112112
public final String toCookieHeaderString(){
113113
final StringBuilder OUT = new StringBuilder();
114-
115114
OUT.append(name).append("=").append(value);
116115
if(expires != null)
117116
OUT.append("; Expires=").append(new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss").format(expires)).append(" GMT");
@@ -148,7 +147,7 @@ public static class Builder {
148147
private String path;
149148
private String sameSite;
150149
private Date expires;
151-
private int maxAge;
150+
private Integer maxAge;
152151
private Boolean secure;
153152
private Boolean httpOnly;
154153

src/main/java/com/kttdevelopment/simplehttpserver/SimpleHttpExchangeImpl.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,9 +328,7 @@ public synchronized final HttpSession getHttpSession(){
328328
if((sessionId = cookies.get("__session-id")) == null || !HttpSession.sessions.containsKey(sessionId)){
329329
session = HttpSession.create();
330330
setCookie(
331-
new SimpleHttpCookie.Builder("__sesion-id",session.getSessionID())
332-
.setHttpOnly(true)
333-
.build()
331+
new SimpleHttpCookie.Builder("__session-id",session.getSessionID()).build()
334332
);
335333
}else{
336334
session = HttpSession.sessions.get(sessionId);

0 commit comments

Comments
 (0)