From 8e5460cefae50cff95dd376c042077757109cb25 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Mon, 20 Oct 2014 18:02:41 +0800 Subject: [PATCH] . --- conf/wide.json | 9 ++------- main.go | 6 +++--- shell/shells.go | 2 +- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/conf/wide.json b/conf/wide.json index f7a6740..66248d9 100644 --- a/conf/wide.json +++ b/conf/wide.json @@ -16,13 +16,8 @@ "Password": "admin", "Workspace": "{pwd}/data/user_workspaces/admin", "LatestSessionContent": { - "FileTree": [ - "E:\\Work\\go\\src\\github.com\\b3log\\wide\\data\\user_workspaces\\admin\\src\\mytest", - "E:\\Work\\go\\src\\github.com\\b3log\\wide\\data\\user_workspaces\\admin\\src\\mytest\\hello" - ], - "Files": [ - "E:\\Work\\go\\src\\github.com\\b3log\\wide\\data\\user_workspaces\\admin\\src\\mytest\\hello\\main.go" - ], + "FileTree": [], + "Files": [], "CurrentFile": "" } } diff --git a/main.go b/main.go index 4d89340..b18f649 100644 --- a/main.go +++ b/main.go @@ -118,7 +118,7 @@ func logoutHandler(w http.ResponseWriter, r *http.Request) { httpSession, _ := session.HTTPSession.Get(r, "wide-session") - httpSession.Options.MaxAge = 0 + httpSession.Options.MaxAge = -1 httpSession.Save(r, w) } @@ -129,7 +129,7 @@ func indexHandler(w http.ResponseWriter, r *http.Request) { httpSession, _ := session.HTTPSession.Get(r, "wide-session") if httpSession.IsNew { - http.Redirect(w, r, "/login", http.StatusForbidden) + http.Redirect(w, r, "/login", http.StatusFound) return } @@ -177,7 +177,7 @@ func startHandler(w http.ResponseWriter, r *http.Request) { httpSession, _ := session.HTTPSession.Get(r, "wide-session") if httpSession.IsNew { - http.Redirect(w, r, "/login", http.StatusForbidden) + http.Redirect(w, r, "/login", http.StatusFound) return } diff --git a/shell/shells.go b/shell/shells.go index 6c92344..07f3644 100644 --- a/shell/shells.go +++ b/shell/shells.go @@ -30,7 +30,7 @@ func IndexHandler(w http.ResponseWriter, r *http.Request) { httpSession, _ := session.HTTPSession.Get(r, "wide-session") if httpSession.IsNew { - http.Redirect(w, r, "/login", http.StatusForbidden) + http.Redirect(w, r, "/login", http.StatusFound) return }