basic implementation of server handling of cookies in c