Reputation: 1435
I am working on one website and currently I am using a cookie to store necessary information used by the consoles, whenever the user log in.
I would like to store the user information from the login not ONLY to the cookie but in a local storage key as well when user logs in and logs out using c#.
Currently I am using javascript to store information in local storage. But same approach is possible with c#?
Please suggest me some way to do so. Thanks.
Upvotes: 0
Views: 2454
Reputation: 8781
C# executes on server while local storage is on the client side. So it is not possible to access local storage using C# directly. This could be done through JavaScript only.
Although you can write custom HtmlHelper (C# code) that generates JavaScript for accessing local storage.
Upvotes: 3