is there a cookie or some on page variable set when a user is logged in?
I have some custom HTML and CSS at the top of my socialgo site which contains a link to the offsite login and registration (we use the API and our main site to process logins and registrations).
What I want to do is change this HTML based on whether a user is logged in or not. I see no reason why I can't do this with javascript, but is there a cookie or some on page variable that is set when someone is logged in that I can test with.
To see what I mean look at http://hownow.socialgo.com , I want the login - register link to appear with edit profile - logout when someone is logged in.
I see that there's some discussion of a javascript API here http://getsatisfaction.com/socialgo/t... which would be useful but really overkill for my purposes.
What I want to do is change this HTML based on whether a user is logged in or not. I see no reason why I can't do this with javascript, but is there a cookie or some on page variable that is set when someone is logged in that I can test with.
To see what I mean look at http://hownow.socialgo.com , I want the login - register link to appear with edit profile - logout when someone is logged in.
I see that there's some discussion of a javascript API here http://getsatisfaction.com/socialgo/t... which would be useful but really overkill for my purposes.
1
person has this question
I have this question, too!
Tell me when someone answers.
The more people who ask this question, the more it gets noticed.
The more people who ask this question, the more it gets noticed.
-
Inappropriate?i have no clue on this..some sg guy will help u for sure :)
-
Inappropriate?Simon,
We have a javascript object populated on the page when a user is logged in.
The object can be accessed by calling "window.presence.user".
It contains their user id, their nickname and some links to their profile photos.
Just check for that object and you can safely assume the user is logged in.
Jamie -
Inappropriate?Hi - What fields are required to put the login on a separate site?
Is there a security risk in doing so?
i.e.: let users login to rob.socialgo.com from a form on rob.com?
Thanks
I’m amused
-
Inappropriate?Hi Rob
You can use the API to do this if your server for rob.com has php enabled, the API returns a unique 1 use URL for them to login, so we just auto redirect usign javascript to that URL if they log in seperately.
You could also try submitting a form with the same username and password field names to the login page at socialgo. It won't be as elegant but it would work.
Security wise it's the usual aspects of controlling your own database and scripts. Someone from socialGo might be able to give you more info on that. -
Inappropriate?My example using rob.com as the originator was a lousy one -
This is an external site - and while I'm happy to have their members logging in - I think I would need to give them more than the field names, yes?
frmdatelastloggedin
and
rurl
seem to be 2 other fields in the login form....
Loading Profile...




EMPLOYEE
