Auth again

Cleaned up auth again, wasn't quite happy with it.  Also added cookie
logic as well.