If you have a database (or in general some writable store), the bestway to do authentication in a web app is with session ID cookies. Everytime someone logs in, you pick a large random number to be their sessionID, give them a cookie with the session ID, and then store all of thedetails in your database under the session ID. When they come back, youget the session ID cookie, look it up in the database, make sure it's(still) valid
Courtesy of Planet Python , I stumbledover Peter Bengtsson's puzzlement with Python's tempfile module ,especially the mkstemp() function. It's an understandablepuzzlement, because what's going on is fairly tied to Unix semantics(although Python supports mkstemp() on all platforms).
The tempfile module's mkstemp() is a relatively thin shim over theUnix mkstemp(3) library routine, which exists to securely createtemporary files. This is more difficult than it looks; there are all
I've been doing various overhauls of DWiki recently (a faster andbetter DWikiText to HTML renderer written by Daniel Martin (and hackedby me, so blame me for any problems) went in tonight, for example).As part of this, I've been looking at the HTML DWiki generates,running it past HTML Tidy and the W3C validator and so on. It's been a learningexperience.
One of the things I've learned is that almost everywhere DWiki codeand templates were