= Problem = You want to store sessions in some persistent form, so that the long-running process can be killed and restarted at any point without messing up user sessions. The method for persistence in this case is a database. = Solution = To do this, you override the default Quixote Session and SessionHandler classes with ones that implement the persistence mechanism you choose. See below for sample implementations of this. = Discussion = = References = Titus Brown has posted an example of storing sessions in an PostgreSQL database [[http://issola.caltech.edu/~t/transfer/sql_example/|here]]. Charles Brandt has posted a modified version of Titus' code that uses SQLObject as the database interface. Available [[http://www.charlesbrandt.com/quixote_sql_sessions.tgz|here]]. Ksenia Marasanova has modified the version of Charles' code for use with SQLObject 0.6.X. Available [[http://ksenia.nl/code/quixote_sql_sessions_06.tgz|here]]. ---- CategoryCookbook