title: Very simple authentication using one-time cookie on nginx
body: <p>I have a site intended only for private consumption by 3 coders. It's simple HTML served by nginx directly but intended for consumption inside and outside the office.</p>
  
  <p>I want to have a simple password or authentication scheme. I could use HTTP auth but these tend to expire fairly often which makes it a pain for people to use. I'm also nervous it's much easier for someone to sniff than cookies.</p>
  
  <p>So I'm wondering if I could just set a cookie on their browsers in JavaScript with a unique long ID and somehow tell nginx to only accept requests (for a particular subdomain) which has this cookie.</p>
  
  <p>Is this simple enough to do? How do I</p>
  
  <ol>
  <li>tell nginx to filter by cookie</li>
  <li>in the browser, set a cookie that never expires?</li>
  </ol>