Driver's Door Handle Problem (keyless)

I have read a couple things about this and just want to clarify what the problem is before i go out and buy a new door hand and sensor...

The optical sensor does not work now, i put my hand in the door handle and the car does not unlock, i have to pull on the handle once to unlock it, and then again to open the door.

Recently though, I have pulled the handle once to unlock it, and i can hear the car unlock, but when i pull the handle again it doesn't open, it acts like the door is still locked. I did try opening the passenger side door (without touching the sensor) and it opened straight away, meaning that the car was definately unlocked. I went back round to the drivers door and it wouldn't open, but i pressed the unlock button on my key the door handle worked again and the door opened.

What do you guys reckon the problem is?, and what id need to do to fix it.

Cheers