aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/main.go b/main.go
index 6d7fc52..ccce08b 100644
--- a/main.go
+++ b/main.go
@@ -18,7 +18,11 @@ import (
var wrms *Wrms
func landingPage(w http.ResponseWriter, r *http.Request) {
- http.Redirect(w, r, "/static/index.html", 301)
+ if _, err := r.Cookie("UUID"); err != nil {
+ http.SetCookie(w, &http.Cookie{Name: "UUID", Value: uuid.NewString(), Path: "/",})
+ }
+
+ http.Redirect(w, r, "/static/index.html", http.StatusSeeOther)
}
func searchHandler(w http.ResponseWriter, r *http.Request) {