Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Logout from LinkedIn API

I have worked with LinkedIn API and need guidance about logging out from Linkedin API once I click Logout in my application. I have tried the following code:

function closeSession(){
    IN.User.logout();
}
<a href="logout.php" class="myButton" onclick="closeSession()" id="logout-link">Logout In LinkedIn</a>

I have also tried:

$('logout-link').click(function() {  
    IN.Event.on(IN,'logout', function() {
        window.location.href = [site-logout-url];
    });
    IN.User.logout();
});

I tried to destroy the session in a browser by calling session_destroy()

Finally, I tried the answer I got from Stack Overflow for this question. I didn't get any right solution. Can anyone tell me the solution?

like image 846
MUTHURAJ Avatar asked Dec 18 '12 04:12

MUTHURAJ


1 Answers

Make sure that you have include

<script type="text/javascript" src="http://platform.linkedin.com/in.js"></script>  

on your home page, i.e. where you are logging out.

like image 152
Sridhar Avatar answered Oct 26 '22 15:10

Sridhar