搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

dotjs javascript failing

more options

Hello all, my school website is kind of a pain in that you cannot stay logged in between session, so being a CS major I have set out to fix this problem. I found that basically the whole login process sets one cookie in the browser called canvas_session. If you set this cookie (I have done this via an add-on) then the website thinks your logged in. I have already created a program that takes and stores my username and password and returns a valid canvas_session cookie, I just cant figure out how to set it in the browser. I found "dotjs" which is an add-on that runs a javascript file based on your current website that's open. I can set cookies via javascript and have been able to create fake cookies using this add-on. When my schools website first loads up, a canvas_session cookie is set by the website, but it has a value that does not equal a valid login token, so it takes me to the login page. The problem is that whenever I load up my schools website, and MY javascript to set the canvas_session cookie is run, the cookie doesn't change from the default cookie that the site loads up at the beginning. I have read here: http://blog.mozilla.org/addons/2012/04/16/code-review-browser-hacking-with-dotjs/ that this add-on loads up the website first, then runs my javascript so my javascript is being executed after(I think) the website first sets its default canvas_session cookie. Any ideas as to how to set this cookie and why this isn't working?

Thanks a bunch!

Hello all, my school website is kind of a pain in that you cannot stay logged in between session, so being a CS major I have set out to fix this problem. I found that basically the whole login process sets one cookie in the browser called canvas_session. If you set this cookie (I have done this via an add-on) then the website thinks your logged in. I have already created a program that takes and stores my username and password and returns a valid canvas_session cookie, I just cant figure out how to set it in the browser. I found "dotjs" which is an add-on that runs a javascript file based on your current website that's open. I can set cookies via javascript and have been able to create fake cookies using this add-on. When my schools website first loads up, a canvas_session cookie is set by the website, but it has a value that does not equal a valid login token, so it takes me to the login page. The problem is that whenever I load up my schools website, and MY javascript to set the canvas_session cookie is run, the cookie doesn't change from the default cookie that the site loads up at the beginning. I have read here: http://blog.mozilla.org/addons/2012/04/16/code-review-browser-hacking-with-dotjs/ that this add-on loads up the website first, then runs my javascript so my javascript is being executed after(I think) the website first sets its default canvas_session cookie. Any ideas as to how to set this cookie and why this isn't working? Thanks a bunch!

所有回覆 (1)

more options

I think you need to send the cookie to the server when requesting the page. This will admit you to the existing session created by your login program, and the server should echo the cookie back to Firefox. I actually haven't used any extensions that could do that.