 koding = require './bongo'
+
+{ argv } = require 'optimist'
+KONFIG = require('koding-config-manager').load "main.#{argv.c}"
 
 error_messages =
   404: 'Page not found'

  getClientId
  isInAppRoute
  isMainDomain
}



  ]

  return host in mainDomains


{ sessionCookie } = KONFIG

setSessionCookie = (res, sessionId, options = {}) ->

  options.path    = '/'
  options.secure  = sessionCookie.secure
  options.expires = new Date(Date.now() + sessionCookie.maxAge)

  res.cookie 'clientId', sessionId, options


module.exports = {
