Example #1
0
func WriteRememberCookie(user *models.User, ctx *context.Context) {
	secret := utils.EncodeMd5(user.Rands + user.Password)
	days := 86400 * setting.LoginRememberDays
	ctx.SetCookie(setting.CookieUserName, user.UserName, days)
	ctx.SetSecureCookie(secret, setting.CookieRememberName, user.UserName, days)
}
Example #2
0
func (this *BaseController) WriteRememberCookie(u *user.User, ctx *context.Context) {
	secret := utils.EncodeMd5(u.PasswordSalt + u.Password)
	days := 86400 * setting.LoginRememberDays
	ctx.SetCookie(setting.CookieUsername, u.Username, days)
	ctx.SetSecureCookie(secret, setting.CookieRememberName, u.Username, days)
}