Here is how HTTP authentication is supposed to work:
In HTTP authentication, the browser uses a dialog box to get the user's credentials. It looks something like this.
A (perceived) downside to HTTP authentication is that web designers cannot control this dialog. Some people find this ugly nad its messes with website design and layout. As a result, many websites use what is called FORMs authentication, where the website collects a user's credentials in an HTML form, and submits them to the user.
Unfortunately, Memestreams does an RFC-violating combination of the two. It responds to resources that require login with a 401, but without specifying the WWW-Authenticate header to tell the browser how to send the credentials back.
What should happen is this:
Client Server
-------------->
GET /recommend/ HTTP/1.1
Client Server
<--------------
HTTP/1.1 302 Redirect
Location: /login/?returnURL=/recommend/
Client Server
-------------->
GET /login/?returnURL=/recommend/ HTTP/1.1
Client Server
<--------------
HTTP/1.1 200 Ok
[user files in username/password]
Client Server
-------------->
POST /login/?returnURL=/recommend/ HTTP/1.1
[post data with username and password]
Client Server
<--------------
HTTP/1.1 302 Redirect
Location: /recommend/
Set-Cookie: [set valid session cookie]
Client Server
-------------->
GET /recommend/ HTTP/1.1
Client Server
<--------------
HTTP/1.1 200 Ok
TreyChair.com - Multifunction task chairs for your desk, floor, home, or office.
Topic: Technology
12:59 pm EDT, Aug 20, 2007
Saw this today on Ars. Not sure how great it would be as an office chair (at least if you attempt to use it with a desk). But as a gamer/laptop chair, looks fairly cool.
Can I write a recursive depth JavaScript parser in 1.5 days? The answer is yes, but it doesn't support the complete language yet. So far I don't support:
-anonymous functions -the "with" statement -"for...in" blocks -labels and labeled continues (bet you didn't know JavaScript had labels!) -any of the bitwise operators ( & | ^ << >>) -assignment with operations ( += /= -= etc) -the ?: construct -array or object literals -declaring and initializing multiple variables with a single var statement.
To be fair, I've just been writing the JS parser. I am using a JS tokenizer I wrote a few months back (though I've been finding/fixing a number of bugs in it today).
Jill out of town for work... Check 1.75L Grey Goose... Check 12 Pack Dr. Pepper... Check Visual Studio 2005 Team Edition... Check EMCAScript Standard 3rd Edition... Check Rhino Book... Check Purple Book... Check Working from home tomorrow... Check Nidhi's super secret static analysis code... Check
Can I write a recursive descent JavaScript parser before tomorrow afternoon? Let's find out.
Nidhi: My Dragon Book can so beat up your Louden Book Me: That's it Nidhi, I'm sick of your talking smack! It's compiler design duel time! Ray: [walking by] ... [looks at us] ... *sigh* ... [keeps walking]