It's to automatically turn on the lamp when it's dark out, and turn it off when it gets light.
Our OP just needs to find a shorter bulb. There is a terrific variety of lamps available, but one needs to look further than the housewares section of a grocery store, where the selection is slim pickings. The OP may need to look at a specialty bulb supplier.
Yes but i don't think he has answer the question. Maybe is a way to test if lamp is ok. Making a dark activated switch this way is a little bit not corect because the sensor should be attached somewhere else and not on lamp...