'Storing Data in Models (.net.) vs sessionStorage
Generic best practices question.
https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage
I recently started a new job as web developer. Fairly fresh out of college and pretty new to .net. I was given a pretty simple task to start with, which is great.
so I have a table and a user can select someone in a table and go to a page for information about the thing they selected. they can them change their mind and go back to the page with the table in which case the option that they had previously selected should be preselected.
I was trying to go about it with the link above and storing the information through js sessions. Another person on my team steered me away from that and said I should just be adding variables to the .net models and passing data through the controller instead of storing it in the browser. while both ways obtain the same result I still like my way better because I feel like I'm not continuing to clutter an already cluttered model. on the other hand I guess it could be possible to clutter session storage in the same way.
I should mention session storage is not being used at all currently, so it may be easier to not use more than one MO, though I think it is a matter of preference.
I think session storage is probably insecure if we were storing something important but they already have access to whatever they'd see in session storage in this case. Does anyone have any thoughts on if there is a "right way?"
I think for starters I'll probably do it his way. Not exactly looking to make waves in a new company without strong Experience or at least documentation to back up what I say.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
