Frequently I have seen people use the term order in cryptography (the group theoretic one). I have a mathematical background and order (say for prime modulus $p$) is defined as the smallest integer such that
$$a^r \equiv 1 \pmod p$$
So a generator (something which has the max possible order i.e order is $\phi(p)=p-1$) will have order (p-1). In case of a composite group, the generator should have an order $=\phi(N)$.
How is it that frequently I read in Crypto literature that people say generator has order N?
For example: The first answer at: When do we need composite order groups for bilinear maps and when prime order?
Am I missing some details or is my understanding incorrect?