Click here to Skip to main content
15,891,607 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
in mvc if i copy url and opened in other browser it should br redirected to login page how to do that
Posted

1 solution

If your application is implementing authentication then it will happen by default. Just check whether or not you are creating a persistent cookie for the authentication ticket. Because if you have implemented persistent cookie then it wont ask for login again.

refer this: A Beginner's Tutorial on Custom Forms Authentication in ASP.NET MVC Application[^]

C#
FormsAuthentication.SetAuthCookie(username, false);


The second argument should be false to have a non persistent cookie.
 
Share this answer
 
Comments
sailaja12345672 26-Dec-13 8:33am    
im not getting that one can u tell me whree i have to take changes

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900