If the user already logged in then he will want to logout. In this time session should destroy. Below the code will be used for that purpose.