Skip to content

Commit b71be4b

Browse files
committed
Merge remote-tracking branch 'refs/remotes/origin/2.2.0-dev'
2 parents 3d8e50f + 923b1f6 commit b71be4b

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

src/main/java/org/b3log/solo/processor/IndexProcessor.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
*
6060
* @author <a href="http://88250.b3log.org">Liang Ding</a>
6161
* @author <a href="mailto:385321165@qq.com">DASHU</a>
62-
* @version 1.2.3.6, May 7, 2017
62+
* @version 1.2.4.6, Jun 28, 2017
6363
* @since 0.3.1
6464
*/
6565
@RequestProcessor
@@ -97,8 +97,8 @@ public class IndexProcessor {
9797
/**
9898
* Shows index with the specified context.
9999
*
100-
* @param context the specified context
101-
* @param request the specified HTTP servlet request
100+
* @param context the specified context
101+
* @param request the specified HTTP servlet request
102102
* @param response the specified HTTP servlet response
103103
*/
104104
@RequestProcessing(value = {"/\\d*", ""}, uriPatternsMode = URIPatternMode.REGEX, method = HTTPRequestMethod.GET)
@@ -119,8 +119,8 @@ public void showIndex(final HTTPRequestContext context, final HttpServletRequest
119119
if ("default".equals(specifiedSkin)) {
120120
specifiedSkin = preference.optString(Option.ID_C_SKIN_DIR_NAME);
121121

122-
final Cookie cookie = new Cookie("skin", null);
123-
cookie.setMaxAge(0);
122+
final Cookie cookie = new Cookie(Skin.SKIN, null);
123+
cookie.setMaxAge(60 * 60); // 1 hour
124124
cookie.setPath("/");
125125
response.addCookie(cookie);
126126
}
@@ -158,6 +158,7 @@ public void showIndex(final HTTPRequestContext context, final HttpServletRequest
158158
// https://github.com/b3log/solo/issues/12060
159159
if (!preference.optString(Skin.SKIN_DIR_NAME).equals(specifiedSkin) && !Requests.mobileRequest(request)) {
160160
final Cookie cookie = new Cookie(Skin.SKIN, specifiedSkin);
161+
cookie.setMaxAge(60 * 60); // 1 hour
161162
cookie.setPath("/");
162163
response.addCookie(cookie);
163164
}
@@ -175,8 +176,8 @@ public void showIndex(final HTTPRequestContext context, final HttpServletRequest
175176
/**
176177
* Shows kill browser page with the specified context.
177178
*
178-
* @param context the specified context
179-
* @param request the specified HTTP servlet request
179+
* @param context the specified context
180+
* @param request the specified HTTP servlet request
180181
* @param response the specified HTTP servlet response
181182
*/
182183
@RequestProcessing(value = "/kill-browser", method = HTTPRequestMethod.GET)
@@ -212,8 +213,8 @@ public void showKillBrowser(final HTTPRequestContext context, final HttpServletR
212213
/**
213214
* Show register page.
214215
*
215-
* @param context the specified context
216-
* @param request the specified HTTP servlet request
216+
* @param context the specified context
217+
* @param request the specified HTTP servlet request
217218
* @param response the specified HTTP servlet response
218219
*/
219220
@RequestProcessing(value = "/register", method = HTTPRequestMethod.GET)

src/main/java/org/b3log/solo/processor/console/PreferenceConsole.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@ public void updatePreference(final HttpServletRequest request, final HttpServlet
401401
preferenceMgmtService.updatePreference(preference);
402402

403403
final Cookie cookie = new Cookie(Skin.SKIN, preference.getString(Skin.SKIN_DIR_NAME));
404+
cookie.setMaxAge(60 * 60); // 1 hour
404405
cookie.setPath("/");
405406
response.addCookie(cookie);
406407

0 commit comments

Comments
 (0)