Some cars have a three position switch (in series) - always on - always off - on and off according to the door opening.
There will be the light bulb itself - switches (in parallel) that sense the door opening and a fuse.
There may also be a timer circuit to delay the turning off.
These are the areas to pay attention to - there is a very remote possibility of a wiring fault - a poor connection perhaps.
Peccavi, June 2011