tags:

views:

618

answers:

5

I have recently added OpenID login to my website. But I don't know how to add the logout feature.

For example, on clicking the Sign In button I am able to show the login form of the selected OpenID provider, for example Google Account. However, I don't know how to implement a Sign Out button to sign out of the Google Account.

Please advice.

+2  A: 

OpenID relying party can't log user out of OP, you can only implement local logout. Just like RP can not log user into OP.

Michael Krelin - hacker
Yup. What you're asking for is a Single-Sign-Out feature, which OpenID does not implement.
Andrew Arnott
A: 

Just destroy the session.

troelskn
A: 

I'm doing my project and stuck in the logout problem I don't know how to do that like you I have solved by reset all of the cookie because i don't know the cookie that set the logging in status i need to know it.

Sak.Roket
I think that clearing all the cookies would log out the user of all the websites he has logged in say Google, Yahoo!, Facebook, etc. Not sure whether I am correct.Can you plz post the code?
Madhu
A: 

you must have created some session variables after successful verification from openid provider, you just need to destroy those session variables. You cannot destroy the session that is created by the openid provider.

Gaurav Sharma
A: 

I think you're mixing paradigms (hate that word, but can't think of a better one to use just now). Your login link sends the user to their OpenID provider for authentication, but it's not the user logging in to their Google account that's the important bit, it's logging in to your website, by providing credentials via OpenID. The user may well already be logged in to their OpenID provider; you don't (can't) know and don't have to care.

Similarly, the logout link on your site should log the user out of your site only, returning them to the same state as before they clicked the login button. The user might have logged out of their OpenID provider already; you neither know nor care. This site is a good example :).

Andrew Aylett