As I was going through creating my authentication mechanism in an application when I stumbled upon the FormsAuthenticationTicket.Version property. The docs do not exemplify any use case and I found no reference for it's use anywhere else.
Did anyone use it already?
Thanks
FormsAuthenticationTicket(Int32, String, DateTime, DateTime, Boolean, String, String) Initializes a new instance of the FormsAuthenticationTicket class with cookie name, version, directory path, issue date, expiration date, persistence, and user-defined data.
The SetAuthCookie method adds a forms-authentication ticket to either the cookies collection or the URL if CookiesSupported is false . The forms-authentication ticket supplies forms-authentication information to the next request made by the browser.
The ASPXAUTH cookie is used to determine if a user is authenticated. As far as the location of the cookie, that depends on your browser. If you are using Firefox you can view the cookie by clicking on Tools -> Options -> Privacy. Then scroll down to the domain and expand it to see the cookie and its value.
This was created for future use, so it can transpose tickets of a previous version to the current. In .NET 1.1, the default value is 1. Starting with .NET 2.0, the default value is 2. Unless, of course, you override this value when constructing a ticket manually.
The framework doesn't really do anything with this value currently. You could use it yourself (and specify your own "version") to understand the data contained in a ticket as your application evolves and deals with persistent cookies, but mostly, you'll probably just ignore it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With