in reply to Sending cookies without module

Just look at the code for CGI, that will show you how. But it would be a lot easier to just use that module instead of reading it and recreating it. Is there a reason for your "without using modules" caveat?