Skip to content

Commit

Permalink
Cookie definition was missing Path, README updates
Browse files Browse the repository at this point in the history
  • Loading branch information
fingon committed Apr 27, 2024
1 parent 41adace commit 4ae900a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@ local Lixie instance which probably does not exist.

- Properly vendor static resources (bootstrap CSS, htmx JS)

+ convert viewing preferences to be tracked via cookie
- FTS filter: global (partially implemented)
- others: per-view

- identify better logging pattern
- identify better logging pattern than printf :p

## Prettiness

- favicon

- style the pages properly (right now just basic Bootstrap and one or two
ugly bits remain)

- perhaps submit names + fields should still be from variables and not
hardcoded to templ files? problem is, the golang tags cannot(?) be based
on variables anyway
9 changes: 5 additions & 4 deletions cm/write.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* Copyright (c) 2024 Markus Stenberg
*
* Created: Fri Apr 26 14:08:31 2024 mstenber
* Last modified: Fri Apr 26 14:19:38 2024 mstenber
* Edit time: 0 min
* Last modified: Sat Apr 27 09:12:05 2024 mstenber
* Edit time: 2 min
*
*/

Expand All @@ -27,13 +27,14 @@ func ToCookie(state any) (*http.Cookie, error) {
if err != nil {
return nil, err
}
expiration := time.Now().Add(365 * 24 * time.Hour)
// TODO refresh handling
expiration := time.Now().Add(7 * 24 * time.Hour)
name, err := cookieName(state)
if err != nil {
return nil, err
}
value := base64.StdEncoding.EncodeToString(data)
cookie := http.Cookie{Name: name, Value: value, Expires: expiration}
cookie := http.Cookie{Name: name, Value: value, Expires: expiration, Path: "/"}
return &cookie, nil
}

Expand Down

0 comments on commit 4ae900a

Please sign in to comment.