I am trying to pass a Session value from MVC controller to my jascript variable. Here is what i have tried
--ASP.NET MVC Controller--
Session["UserGroups"] = model.Groupes as List<string>;
--JS----
<script>
var my_groups = '@Session["UserGroups"]';
console.log(my_groups);
</script>
--Output--
System.Collections.Generic.List`1[System.String]
I would appreciate any help or another approach i can use to achieve my goal. Thanks