1

I have a client web application that allow users to LOCK the screen without the need to log out from the application, this action just hides the elements on the screen and show a lock screen.

Obviously, when I inspecting the elements on the page I still can see the elements on the page and their data.

What is the best solution to hide the elements from the inspect html? storing the html on javascript parameters and removing the html from the page will be a good solution for this problem? I'm just thinking of it and it seem that their is not a secured solution to hide data in html

1
  • 4
    It won't as you would still be able to access the javascript variable through console. Best solution would be to send the html to back-end, store it there, remove it from the web page, and then request the html from back-end (via ajax or similar) to display it back Commented Mar 1, 2012 at 10:09

2 Answers 2

3

If your lock is for security reasons then it's better to implement a server-side lock and move the user to another page (saving the page state and restoring it afterwards). Messing with the markup using JS is more complicated and everyone can fool your logic by disabling or executing some inline JS with a debug tool.

Sign up to request clarification or add additional context in comments.

Comments

0

The only option is get html content, store it in, say, localStorage encrypting it with password, which user should input and don't save that password. Then when user returns, prompt for password again and decrypt content.

Server-side solution with logout/login should be simpler, though.

Anyway, you'll need to identify user in order to protect your app from unauthorized usage of another person.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.