Home » Magento10 October 2011

Magento: Redirect Customer to Login page if not logged in

If you are developing a module which needs to give access to its content only to logged in user then the preDispatch function will be very useful. This dispatches event before action.

Just write the following function in your module’s controller and customer log in is checked before each of your controller action.

Hope this helps. Thanks.


Get New Post by Email

Find me on

FacebookTwitterGoogle+LinkedInRSS Feed
  • Vineetsajwan


  • sagar sapkota

    i kept this function on customer module’s controller, where do i call this function so that my home page is redirected to log in page if not logged in.