13

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

tucaz
  • 6,524
  • 6
  • 37
  • 60
  • MSDN would be better served by providing real world examples of what the property is used for. The "Remarks" section provides no usage information. – felickz Jul 10 '13 at 17:09

1 Answers1

13

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.

moribvndvs
  • 42,191
  • 11
  • 135
  • 149
  • Note also related settings [MachineKeySection.CompatibilityMode](http://msdn.microsoft.com/en-us/library/system.web.configuration.machinekeysection.compatibilitymode.aspx) and [FormsAuthenticationConfiguration.TicketCompatibilityMode](http://msdn.microsoft.com/en-us/library/system.web.configuration.formsauthenticationconfiguration.ticketcompatibilitymode.aspx) – explunit Oct 31 '12 at 21:48
  • 1
    It's strange that an unused value like that would be the first, and required, parameter on the 2nd and 3rd overload for creating a ticket. Like I can't specify userData without supplying it even though neither I nor Microsoft does anything with it. Which is not a big deal once I realize it's not for any purpose currently, but I typically assume that required parameters are there for a reason and that I should fill them in properly. – BVernon Mar 01 '18 at 00:58