Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

How should I keep UserId (in a hidden input or as session value)

$
0
0

Hi all,

In a SPA I need to use UserID to save related data.

I use  <input id="UserId" hidden value="@Model.Id" /> this technique to get it.

But what about havving a session and keep the UserId there?

Is it safer ?

But if connection is gone and come back while typing session data also may have gone and it may cause unwanted errors

If I am thinking right because I don't have experience in that area


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>