IE会话cookies助手
IE Session cookie helper
原作者: Tarun Lalwani
译者:黄启鲁, Jenvee, Jeff, Wally
原文地址:
http://knowledgeinbox.com/downloads/general/ie-session-cookie-helper/
日期:2009-09-02
E测中国翻译团队作品
【译文】:
每当我们在浏览网站的时候,在你的机器上就可能会产生一些cookies。cookies有两种类型:
持久性Cookies
这些cookies存在于你的电脑硬盘的缓冲区内。它们一直保留在你的电脑中直到被删除或过期。正是基于这种cookies 的网站可以在浏览器中被反复测试。如果你访问http://www.sqaforums.com/login.php?Cat=0,并用你的id登录后再次访问这个链接,那么你会发现它不再显示用户id和密码输入框了。现在清除掉cookies并再次访问这个链接,你将又会看见用户id和密码输入框了。正是由于该站点使用了持久cookies,只要删掉这些cookies,我们就可以在同一个浏览器中重新登录。
非持久性cookies
这种cookies也被称为会话cookies,它们仅存在于浏览器会话期间,当浏览器关闭时被自动清除掉。基于这些cookies的网站不能在同一个浏览器中被反复测试。如果你访问www.gmail.com,登录到你到账号,然后删除cookies,并试着再次登录,你将会发现在没有退出账号的情况下无法获得登录框。由于gmail创建了一些保存登录信息的会话cookies,在没有登出的情况下无法在同一个浏览器中重新登录。
会话cookies只能被产生它们的进程删除掉。由于IE不提供任何删除一个特定浏览程序会话的功能,IE似乎真的对这项任务无能为力。但是,当测试一个约1000次迭代的网站时,每次迭代,关闭和启动一个新的浏览器都会出现问题。这有时会导致电脑性能下降,有时也可能造成电脑挂机。唯一的办法是写一段代码,它可以在目标IE浏览器进程内被执行。
这个技术被称作Code/DLL 注入。我用VC++创建了一个DLL,它包含了清除会话cookies的代码。现在要清除的cookies,我们在IE进程中执行,我们在VB6中使用一个EXE注入器文件为IE注入DLL程序,清除cookies并卸载该DLL.。这些花了我近10天的令人既沮丧又享受的时间做出了这个些既不会使IE崩溃、又能工作良好的小工具。这个小工具是目前互联网上独一无二的哦。
下载工具地址:IE Helper setup
【原文】:
Author: Tarun Lalwani
Original URL: http://knowledgeinbox.com/downloads/general/ie-session-cookie-helper/
Whenever we browse a website it may create some cookies onyour machine. There are two types of cookies
PersistentCookies
These cookies are on cached on your machine disk. Thesecookies remain on your pc until deleted or expired. Websites based on justthese cookies can be tested again and again in a browser. If you browse on tohttp://www.sqaforums.com/login.php?Cat=0 and login using your id and browse thesame link again then you will see that you are no more shown the user id andpassword box. Now delete the cookies and browse the link again and you will seethe user id and password text box. Since the site used just the persistentcookies we were able to re-login in the same browser just by deleting the cookies.
Non-Persistentcookies
Also known as session cookies these remain only in thebrowser session and are automatically deleted when the browser is closed.Websites based on these cookies cannot be tested again and again in the samebrowser. If you browse to www.gmail.com and login to your account then deletecookies and try to login again then you will notice that there is no way to getthe login box without logging account from your account. Since gmail createdsome session cookies for storing the login information it is not possible tore-login in the same browser without a logout.
Session cookies can only deleted by the process whichcreated it. Since IE does not provide any function for deleting the session ofa specific browser it really looked impossible to do this task. But whentesting a website for a iterations in the order of 1000s it gets problematicfor closing the browser and launching a new one for each iteration. It couldsometimes lead to performance degrade for that pc and sometimes may hang the pcas well. The only workaround was to make such a code which can be executed within the process boundary of the destination IE browser.
This technique is called Code/DLL Injection. I created aDLL in VC++ containing the code for deleting session cookies. Now to delete thecookies we execute this inside the IE process for which we use a Injector exein VB6 which injects the DLL inside IE, clears cookies and the unloads the DLL.Well it took me nearly 10 frustrating and enjoying days to make something whichdoes not crash IE and work fine also. But the end product was something that isnowhere available on net currently
版权声明:本文为E测翻译团队原创作品。E测中国(www.5etesting.com)网及相关内容提供者拥有
5etesting.com内容的全部版权,未经明确的书面许可,任何人或单位不得对本网站内容复制、
转载或进行镜像,否则将追究法律责任。