Hi Namita,
Unfortunately, there isn't such a setting out of the box and this piece of functionality requires custom development. To be honest, this is not related to Kentico, it's just the nature of Forms or OWIN authentication (depending on whether you are using Portal Engine or MVC model). Quick googling shows it is possible to customize with your own code: here is an example for Forms, and this and this ones are for MVC.