how to use session using javascript


BY LOVE
sessionStorage.setItem("SessionName", "SessionValue");

<script type="text/javascript">
function GetUserName()
{
‚Äč
var username = '<%= Session["UserName"] %>';
alert(username );
}
</script>

<script type="text/javascript">
function SetUserName()
{
var userName = "Shahid Bhat";
'<%Session["UserName"] = "' + userName + '"; %>';
alert('<%=Session["UserName"] %>');
}
</script>

www.codegrepper.com
www.stackoverflow.com

Leave a Reply

Your email address will not be published. Required fields are marked *