title: Session management via pure CGI
body: <p>I'm currently in the process of writing a little blog / generic posting system using CGI in C as a hobby project and am now in the need of a session management system to authentificate authorized users for posting, editing and similar operations over <strong>multiple CGI programs</strong></p>
  
  <p>From working with PHP years ago I remember using the superglobal variable <code>$_SESSION</code> and some session intializing functions. <em>Obviously</em> this is not going to work this way when dealing with pure CGI, so I'm in a tricky situation here.</p>
  
  <p>A bit of thinking showed that there's many different ways to do such a thing...</p>
  
  <ol>
  <li>Saving the IP address and attributes inside a file where I can see if a particular IP is authorized</li>
  <li>Same as #1 but using an SQLite database (my engine already runs on SQLite so there would be no additional overhead)</li>
  <li>Something with cookies maybe?</li>
  </ol>
  
  <p>Instead of going all in and regret is later... what do <strong>you</strong> good people think? What's the most efficient (and most importantly) and the maintainable method?</p>
  
  <p>Please note that I do <em>not</em> want to get a third party libary to do all the complicated things for me! I started this project to build something completely by myself (if you ignore SQLite here) and I don't want to hide the hard parts, even if it makes everything so much simpler. I could have just used Python if I didn't want to torture myself :)</p>