Magento – How to login customer programmatically

This post show login customer programmatically in Magento. In this given code will allow to login user/customer to login if they are not logion already. If user is not login then this code create session and allow and set seesion and allow login in magento website to user programmatically.