Sharing cookies for dyanmic domain

Hi folks,
i have two websites and a mob version so
waht i want is that if a user is logged in then when he
switches to he wont have to login again…
Is there any method that anyone can suggest i have tried with some
techniques available on net but they are not working out…