code: func (service *Service) SetLoggedInUser(w http.ResponseWriter, request *http.Request, username string) (err error) {
  	authenticatedSession, err := service.GetSession(request, SessionInteractive, "authenticatedsession")
  	if err != nil {
  		log.Error(err)
  		return
  	}
  	authenticatedSession.Values["username"] = username
  
  	//TODO: rework this, is not really secure I think
  	// Set user cookie after successful login
  	// base64 encode the username. Use standard encoding to enable decoding by native javascript
  	// functions
  	cookie := &http.Cookie{
  		Name:  "itsyou.online.user",
  		Path:  "/",
  		Value: base64.StdEncoding.EncodeToString([]byte(username)),
  	}
  	http.SetCookie(w, cookie)
  
  	// Clear login session
  	loginCookie := &http.Cookie{
  		Name:    "loginsession",
  		Path:    "/",
  		Value:   "",
  		Expires: time.Unix(1, 0),
  	}
  	http.SetCookie(w, loginCookie)
  
  	return
  }
docs: //SetLoggedInUser creates a session for an authenticated user and clears the login session