Hello,
We co-slept w/ our daughter until she was about 4. But we had her napping in her own twin bed (in her room) w/ a rail since she was 18mos and she would start off the night in her own bed by around age 3, then join us back in our bed around 1 a.m.. We loved it, you're so close to your child, but by age 4, our king bed just wasn't big enough for the 3 of us. One morning, my daughter woke up and asked, "Where's dad?" I started teasing her, tickling her, and said, "Dad had to sleep in YOUR bed last night because there is no room in OUR bed for him now!" And that started off the conversation of "now it's time for you to sleep in your own bed/room." Worked like a charm. At first, she would wake up 1-2 times a night and my husband would go into her room, settle her and she'd fall back asleep. After a couple of weeks, she now sleeps all the way through. Good luck!