My patch doesn't work. It doesn't log you in.
I don't know anything about cookies and I hadn't worked with any logging in code until now. If anyone could tell me what's wrong with it, I would appreciate it.
(Sorry, it still has the escaping bml stuff on it. I hope that doesn't make it too hard to read.)
Update: a newer, better patch is here: http://www.livejournal.com/talkread.bml?itemid=20325509