tajMahal
tajMahal

Reputation: 418

how to hide hidden value from source code in html?

In my html I'm using hidden value as :<input type="hidden" value="secure" name="first"> but the problem is when I see in browser console value is displaying .How to hide this?

Upvotes: 0

Views: 2108

Answers (2)

Niels Keurentjes
Niels Keurentjes

Reputation: 41958

You can't. The whole point of a client/server based setup, like 'the web' is by definition, is that everything you transmit to the client can be read by any client.

If you need to secure data from the end user, keep it on the server side. There are a myriad of possible solutions for this, like sessions, cookies and preshared keys, to sync serverside storage with the client.

Upvotes: 1

Quentin
Quentin

Reputation: 943579

The browser belongs to the visitor. You can't give the browser anything without giving it to the visitor as well.

If you don't want to visitor to have access to data, then never give it to the browser in the first place.

Keep the data on the server and send the browser a session token instead.

Upvotes: 2

Related Questions