Cot near bed

My 2 month old wont sleep alone in his cot so his been sharing bed with me and my hubby however its not comfortable so ive joined the cot to the bed took one side down so he feels as if hhis sleeping with me on the bed do you think its a good a idea as im still in two minss