views:

2034

answers:

12

In the SignOut method of System.Web.Security.FormsAuthentication, the ASP.NET team chose to expire the FormsAuth cookie by setting the expiration date to "Oct 12 1999".

HttpCookie cookie = new HttpCookie(FormsCookieName, str);
cookie.HttpOnly = true;
cookie.Path = _FormsCookiePath;
cookie.Expires = new DateTime(0x7cf, 10, 12);

What's the significance of October 12th, 1999? Is it an inside joke, or is there some valid reason to set your cookie expiration to that particular date?

Edit: The theories below are interesting, but they are just guesses. Since Phil, Scott, and other members of the ASP.NET team are on StackOverflow, I thought it would be fun to offer a bounty. Hopefully someone can track down the original developer and get an authoritative answer.

Awarded: To Scott Hanselman for escalating this one all the way to ScottGu. I was really hoping for some sort of super-secret, Illuminati-esque meaning, but looks like it was just the old "one year ago" trick.

+2  A: 

I don't think it's significant. It could just be a meaningless random date in the past, or something like the developer's daughter's birthday - something that has a private meaning to whomever wrote the code.

karim79
+17  A: 

Maybe that line was written on Oct 13th 1999, and they picked "yesterday" as an arbitrary date that would always be in the past.

finnw
+7  A: 

There is no benefit to any specific date when setting the expiration date of a cookie. Any date that is in the past will cause the browser to delete the cookie.

According to Wikipedia:

  • Pervez Musharraf takes power in Pakistan from Nawaz Sharif through a bloodless coup.
  • The Day of Six Billion: The proclaimed 6 billionth living human in the world is born.
  • Death of Robert Marsden Hope, Australian Justice and Royal Commissioner (b. 1919)
  • Death of Wilt Chamberlain, American basketball player (b. 1936)

Of those, the most likely to me seems Wilt the Stilt. Perhaps the author was a basketball fan.

NilObject
Right, so why not Jan 1 1900 or something? Also, why a date so close in the past, as opposed to something from before the PC was even invented?
Portman
Perhaps to avoid a negative epoch. Maybe an early browser didn't handle < 1970 (UNIX epoch) correctly. My guess would be that it probably is an easter egg, although I doubt any of the dates above really are the reason :)
NilObject
+104  A: 

Elementary my dear Watson:

  • Oct 12 1999 is exactly 80 days before 1-1 2000.
  • For some people the year 2000 was the end of the world
  • As we know, it takes 80 days to go around the world.
  • So oct 12 1999 was the last possible day to go around the world.
  • As we know internet is wrapped around the world.
  • So packets (and also cookies) travel around the world.
  • The expiration date of Oct 12 1999 is the symbolic last day a packet could be send.
  • There is no need to send it later than this date.
  • So this is the symbolic date for do not expire.
Gamecat
Friday afternoon effects ;-).
Gamecat
You've missed your calling, sir. Perfect.
Portman
But but but 1 1 2000 is not the end of the millenium!!!1!! :)
1800 INFORMATION
@1800 Information, correct, but as you know (also backed up by literature), if enough people say 2+2=5, then it will be correct ;-).
Gamecat
This reply is genius
Kirschstein
-Sets new expiration date to Oct 12 2011-
Triptych
haha +1.. I did this exact calculation before looking at your answer :D
Anurag
A: 

It's 10/12/99 in America and 12/10/99 in Europe, making for a nice confusing date. No one knows if it is in December!

Karl
The DateTime constructor definitely takes year, then month, then day.
Portman
+7  A: 

I'm not sure it's of any relevance to the development of ASP.NET, but it was my 26th Birthday!

Nick Haslam
+1  A: 

If you convert 1999/10/12 as a hex, it's 7CF/A/C. Now you can do a ROT13 on it and you have 2PS/N/P
Probably the illuminati... ;)

I really don't know if there's any sense with this date. I don't think so.

(CW for fun purposes)

furtelwart
2PS/N/P: 2 peas in a pod ?
Terrapin
+4  A: 

Ok, so no-one I've asked on the team seems to know. Guess is, it was a year to the day after Bill Gates 1998 PDC Keynote???

ScottGal on Stackoverflow!? Thanks for asking around.
Portman
A: 

Just like "how many licks it takes to get to the Tootsie Roll center of a Tootsie Pop", the world may never know.

Greg
+1  A: 

Obviously, the person who wrote it was a big fan of Bill Gates' speech at Telecom '99. Yeah, you remember the one: http://www.microsoft.com/presspass/exec/billg/speeches/1999/10-12telecom.aspx

Blake
+41  A: 

Ok, folks, I talked to a dozen different people on the ASP.NET Team. The dev who wrote THAT line of code, we think, is gone. We asked The Gu, and he wasn't sure.

Stefan Schackow, from the team, said, after speaking with Manu Vasandani:

"The ASP.NET developers were being chased by a pack of feral ninjas on fire and thus were under intense pressure to complete the feature whilst fearing for their lives. As a result in the heat of the moment(ary passion) the snap decision was made to set the constant to the current point in time, less one year. Unfortunately the developer who made that decision wasn’t fast enough checking it in, and despite the shortcut ended up dying an agonizing death at the hands of the ninja leader 'Eviscerati Extremus Minus One'."

Translation? The date is one year before the date that line of code was written.

Scott Hanselman
You asked a dozen people about this? And then you wonder why you're busy...
Will Dean
Accepted for asking The Gu.
Portman
PS: Who would win in a fight between Jon Skeet and The Gu?
Portman
The Gu. Clearly.
Kirschstein
Neither. I think they'd fight side by side.
kbrimington