Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0

Merge pull request #845 from steindornatorinn/cookie-fix2

This should fix the cookie domain issues
Cette révision appartient à :
akuma06 2017-05-30 14:16:51 +02:00 révisé par GitHub
révision e3c8e6a3b1

Voir le fichier

@ -22,6 +22,10 @@ const (
CookieName = "session"
// UserContextKey : key for user context
UserContextKey = "nyaapantsu.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 +62,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 +105,7 @@ func SetCookieHandler(w http.ResponseWriter, r *http.Request, email string, pass
}
cookie := &http.Cookie{
Name: CookieName,
Domain: DomainName,
Value: encoded,
Path: "/",
HttpOnly: true,