Checking if a user is logged in via javascript

210 views
Skip to first unread message

al3d

unread,
Jan 3, 2009, 7:47:51 AM1/3/09
to Twitter Development Talk
Is there a way to simply check if a user is logged into twitter or
not, without asking for their credentials nor trying to get at their
credentials?

I'd like to implement this in order to provide users with extra
options such as replying or retweeting - but only if they're logged
in (there's not much point if they're not)

If possible, could it be done without requesting the username and
password (and the Basic Auth login dialogue box?)

thx

Alex Payne

unread,
Jan 3, 2009, 2:05:22 PM1/3/09
to twitter-deve...@googlegroups.com
Have a look at the <head> section of any HTML page return from
twitter.com. The problem is, due to cross-domain restrictions you
probably can't use this data unless your application is running with
browser-level privileges. For example, the Flock browser makes use of
this information to see if a user is logged-in or not.

--
Alex Payne - API Lead, Twitter, Inc.
http://twitter.com/al3x

Cameron Kaiser

unread,
Jan 3, 2009, 2:16:11 PM1/3/09
to twitter-deve...@googlegroups.com
> Is there a way to simply check if a user is logged into twitter or
> not, without asking for their credentials nor trying to get at their
> credentials?

Look at

http://dcortesi.com/tools/my-first-follow/

more specifically,

http://dcortesi.com/tfollow.js

--
------------------------------------ personal: http://www.cameronkaiser.com/ --
Cameron Kaiser * Floodgap Systems * www.floodgap.com * cka...@floodgap.com
-- You can make it illegal, but you can't make it unpopular. ------------------

Reply all
Reply to author
Forward
0 new messages