Click here to Skip to main content
15,891,529 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi Guys

I am passing id to my ActionResult, I then notice that I can change the id from the browser and move to another record and modify that record with out logging in and access it. Is there a way I can avoid that? maybe when I change that id it redirects to the login page rather?

What I have tried:

Tried to do some lil googling but with no win, then I was thinking of maybe passing a fake or temporary Id and use it rather to find that record but not sure if that will help.
Posted
Updated 21-Jun-16 23:43pm
Comments
Kornfeld Eliyahu Peter 22-Jun-16 4:23am    
Put your action behind login...

1 solution

You can't stop people amending the url, as said you either need authentication or use ids that you can't guess, like GUIDs rather than sequential numbers, but implementing a log-in is the most secure way.

Things you shouldn't spend time doing | The ASP.NET Forums[^]
 
Share this answer
 
Comments
Anele Ngqandu 22-Jun-16 8:34am    
Mmmh, ok ok its acceptable, thank you kindly.

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