Skip to content

Commit 459db2f

Browse files
committed
Added option to disabled session
1 parent b9ecfe6 commit 459db2f

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/main/java/in/erail/route/SessionRouteBuillder.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
public class SessionRouteBuillder extends AbstractRouterBuilderImpl {
1515

1616
private SessionStore mSessionStore;
17+
private boolean mEnableSession = false;
1718

1819
public SessionStore getSessionStore() {
1920
return mSessionStore;
@@ -28,8 +29,18 @@ public Router getRouter(Router pRouter) {
2829
Route route = pRouter.route();
2930
route.handler(BodyHandler.create());
3031
route.handler(CookieHandler.create());
31-
route.handler(SessionHandler.create(getSessionStore()));
32+
if (isEnableSession()) {
33+
route.handler(SessionHandler.create(getSessionStore()));
34+
}
3235
return pRouter;
3336
}
3437

38+
public boolean isEnableSession() {
39+
return mEnableSession;
40+
}
41+
42+
public void setEnableSession(boolean pEnableSession) {
43+
this.mEnableSession = pEnableSession;
44+
}
45+
3546
}

0 commit comments

Comments
 (0)