- .NET Core 3.1.x
- ASP.NET 3.1.23
Click "OK" link.
- Set
State=OKand redirect to Index page - Show
State=OK(Cookies should be deleted here, but they are not.)
Click "Reload" link. (or F5)
- Expect: State=VIEW
- Actual: State=OK
The code here does not take enum into account.
OriginalValue derived from Cookie is handled as int, but newValue is handled as Enum since it is derived from Property.
See Variables in the following debugger for type differences
eg.) string Message
eg.) enum State
Therefore, newValue.Equals(OriginalValue) becomes (1.Equals((Enum)1) and returns false.
Then tempData[key] = newValue is processed and tempData._initialKeys is set, thus creating a cookie.




