Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 188099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T15:56:38+00:00 2026-05-11T15:56:38+00:00

Any good strategies, code snippets etc for preventing URL manipulation? For example I have

  • 0

Any good strategies, code snippets etc for preventing URL manipulation?

For example I have this url, http://localhost/profile/edit/5 the id could easily be changed to anything and thus people could edit profiles they are not supposed too.

Here are a few ideas I thought of but they all have there drawbacks:

  1. Change my system to use GUID primary keys – makes it almost impossible to guess the keys – but people can still take the GUID from one part of app and use it in another url later.

  2. Use TempData to store the keys – prevents urls being sent around\used later.

  3. Perform checks in the controller before displaying page – means you have to do ‘adminy’ code everywhere to check operations.

Whats the best thing to do? One of these or something else?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T15:56:39+00:00Added an answer on May 11, 2026 at 3:56 pm

    Number 3 is the correct thing to do. Server-Side Security Validation is always what you need, because this is the mechanism that you completely control and can rely on.

    Number 1 is Security by Obscurity, and if someone accidentally posts his URL somewhere (like people often do with Session-IDs when they copy/paste links), your ‘Security’ is broken.

    Number 2 seems like a weak security – if you go through the hassle, better implement proper security. That also allows people to bookmark the page.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Any have any good code for converting a IPv6 address string into an integer?
Are any of you aware of some good strategies for checking for updates on
Any good links are highly appreciated! This goes to community wiki.
Any good example of sorting a NSArray using sortedArrayUsingFunction ? TY!
Any good resources on this? Ideally a tutorial or walkthrough of an application being
Can any one suggest any good tutorial or any set of code which help
I want to know any good link for asp.net MVC-3 video tutorials. I have
Any good recommendations for a platform agnostic (i.e. Javascript) grid control/plugin that will accept
Any good suggestions? Input will be the name of a header file and output
Any good tutorial with source that will demonstrate how to develop neural network (step

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.