It is not wrong to hug someone who is travelling or someone you see after a while..

The school atmosphere will really be looking terrible if students are hugging each other several times a day.