I would like my bookmarklet to require the user to login. Here is the idea....I create an iframe for user to login, and show the a/c information. But I would like to get some information from server, for example, I would like to know whether the user has already added this page to my server or not. So, I want to make an ajax call, but because of the same origin policy, I can't do it by ajax. So, How can I get information from the iframe?
The story is something like this:
User web -> user clicks the bookmarklet -> if logged in -> show an 'add to fav' button -> user clicks the add to fav button, the url is submitted to the server, reload the server.
User web -> user clicks the bookmarklet -> if not logged -> show a login button -> login success -> do the flow as previous
User web -> user clicks the bookmarklet -> if logged -> check if the website is already added on server -> no fav button
As you can see, only the iframe stores the information of the logged in user.