CPH is a rather uncomfortable airport for overnight staying -- but it's way worse landside than airside. Since CPH has some flights departing as late as 1 am or so (if not even later) and has some flights as early as around 6 am, you should be able to stay airside for all the hours or at least half of the time.