I am developing a bookmarklet that essentially adds a toolbar to the user of the webpage that is currently watching. To use it, the user must be logged in.
To enter the system, the user clicks the "Singin" button, which displays a standard form containing the Username, Password, etc. fields. When a user logs in successfully, they can go to another website. When on another page they (a) reload the bookmarklet (b) their session is retrieved from the server (c) the user does not need to log in again. Pretty standard, I would think.
Using Django and jQuery Sessions
I am having trouble implementing the above utility. Here are some of the problems I have encountered:
- POST AJAX cross domain requests are denied. This has been resolved using JSONp. I doubt this is a very safe approach, but it works at the moment.
- My server returns the session ID in the cookie, however, when the user goes to another page, I really donβt know how to get this session ID to send back to my server. Can I even read third-party cookies from my JavaScript?
I am looking for some recommendations for implementing the above utility. Ideally, I do not want to redirect the user to another page so that they can log in. Any suggestion would be greatly appreciated.
Thanks.
source share