I'm creating several sessions, and would like to get the name and value of all of them through JavaScript. Home When creating two Sessions in Asp.Net MVC, for example:
Session["usuario"] = "user";
Session["tipo"] = "comum";
I'd like to get the two sessions on View, without knowing the name.
Example:
<script>
var sessions = getTodasAsSessions(); // Existe alguma função desse tipo?
for(var i = 0; i < sessions.length; i++){
alert("Nome da Session: " + sessions[i].Name + " Valor: " + sessions[i].Value);
}
</script>
Is this possible?