Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0

This should fix the cookie domain issues

Cette révision appartient à :
bragason 2017-05-30 00:42:36 +00:00
Parent d286832090
révision 2e2e5608d4

Voir le fichier

@ -22,6 +22,8 @@ const (
CookieName = "session"
// UserContextKey : key for user context
UserContextKey = "user"
// Domain name : The host domain so these can be shared across sukebei and nyaa
DomainName = "pantsu.cat"
)
// If you want to keep login cookies between restarts you need to make these permanent
@ -58,6 +60,7 @@ func EncodeCookie(userID uint) (string, error) {
func ClearCookie(w http.ResponseWriter) (int, error) {
cookie := &http.Cookie{
Name: CookieName,
Domain: DomainName,
Value: "",
Path: "/",
HttpOnly: true,
@ -100,6 +103,7 @@ func SetCookieHandler(w http.ResponseWriter, r *http.Request, email string, pass
}
cookie := &http.Cookie{
Name: CookieName,
Domain: DomainName,
Value: encoded,
Path: "/",
HttpOnly: true,