Setting session variable using javascript
问题 I am getting name and email id of a user after he logs in via facebook to my website.. I want to add those variables in session on login form itself using javascript; I tried following: FB.api('/me', function(me) { if (me.name) { document.getElementById('auth-displayname').innerHTML = me.name; <% Session["fbName"] = me.name; %> } } it gives error like me (in this line: <%Session["fbName"] = me.name; %>) does not exist in the current context etc.. my div "auth-displayname" is getting that