MVC: Passing a Javascript value to a Session

0

How do I make a sort of "mix" between javascript and razor? I have a page that logs in through facebook, I can login and would like to assign the return of the javascript function that brings the user name, my page session.

More or less like this:

    <script>
        function testAPI() {
            console.log('Welcome!  Fetching your information.... ');
            FB.api('/me', function (response) {
                console.log('Successful login for: ' + response.name);
                '@Session["nome"]' =  response.name; 

            });

        }
    </script>

Note that I'm trying to concatenate, it does not generate an error, but it also returns no value, and console appears the name correctly.

    
asked by anonymous 23.08.2015 / 05:55

0 answers