Results 1 to 5 of 5

Thread: Coockie testing

  1. #1
    Contributing Member
    Join Date
    Aug 2008
    Answers
    31

    Coockie testing

    i want to know abt coockie testing. i know that coockie store login id and password and other details. i m checking my project(using online address) but how can i identify that (login id or password).
    can i access site using coockie details?


  2. #2
    Expert Member
    Join Date
    Apr 2008
    Answers
    1,859

    Re: Coockie testing

    Hi friend

    we will first focus on what exactly cookies are and how they work. It would be easy for you to understand the test cases for testing cookies when you have clear understanding of how cookies work? how cookies stored on hard drive? and how can we edit cookie settings? what is cookie? cookie is small information stored in text file on user’s hard drive by web server.

    This information is later used by web browser to retrieve information from that machine. Generally cookie contains personalized user data or information that is used to communicate between different web pages.
    ]
    Why cookies are used?
    cookies are nothing but the user’s identity and used to track where the user navigated throughout the web site pages. The communication between web browser and web server is stateless. For example if you are accessing domain http://www.example.com/1.html then web browser will simply query to example.com web server for the page 1.html. Next time if you type page as http://www.example.com/2.html then new request is send to example.com web server for sending

    2.html page and web server don’t know anything about to whom the previous page 1.html served.

    What if you want the previous history of this user communication with the web server? you need to maintain the user state and interaction between web browser and web server somewhere. This is where cookie comes into picture. Cookies serve the purpose of maintaining the user interactions with web server.

    How cookies work? the http protocol used to exchange information files on the web is used to maintain the cookies. There are two types of http protocol. Stateless http and stateful http protocol. Stateless http protocol does not keep any record of previously accessed web page history. While stateful http protocol do keep some history of previous web browser and web server interactions and this protocol is used by cookies to maintain the user interactions. Whenever user visits the site or page that is using cookie, small code inside that html page (generally a call to some language script to write the cookie like cookies in javascript, php, perl) writes a text file on users machine called cookie. Here is one example of the code that is used to write cookie and can be placed inside any html page: set-cookie: name=value; expires=date; path=path; domain=domain_name; when user visits the same page or domain later time this cookie is read from disk and used to identify the second visit of the same user on that domain. Expiration time is set while writing the cookie. This time is decided by the application that is going to use the cookie.

    Generally two types of cookies are written on user machine. 1) session cookies: this cookie is active till the browser that invoked the cookie is open. When we close the browser this session cookie gets deleted. Some time session of say 20 minutes can be set to expire the cookie. 2) persistent cookies: the cookies that are written permanently on user machine and lasts for months or years. Where cookies are stored? when any web page application writes cookie it get saved in a text file on user hard disk drive. The path where the cookies get stored depends on the browser. Different browsers store cookie in different paths. E.g. Internet explorer store cookies on path “c:\documents and settings\default user\cookies” here the “default user” can be replaced by the current user you logged in as. Like “administrator”, or user name like “vijay” etc.

    The cookie path can be easily found by navigating through the browser options. In mozilla firefox browser you can even see the cookies in browser options itself. Open the mozila browser, click on tools->options->privacy and then “show cookies” button. How cookies are stored? lets take example of cookie written by rediff.com on mozilla firefox browser: on mozilla firefox browser when you open the page rediff.com or login to your rediffmail account, a cookie will get written on your hard disk. To view this cookie simply click on “show cookies” button mentioned on above path. Click on rediff.com site under this cookie list. You can see different cookies written by rediff domain with different names. Site: rediff.com cookie name: rmid name: rmid (name of the cookie) content: 1d11c8ec44bf49e0… (encrypted content) domain: .rediff.com path: / (any path after the domain name) send for: any type of connection expires: thursday, december 31, 2020 11:59:59 pm

    applications where cookies can be used:
    1) to implement shopping cart: cookies are used for maintaining online ordering system. Cookies remember what user wants to buy. What if user adds some products in their shopping cart and if due to some reason user don’t want to buy those products this time and closes the browser window? when next time same user visits the purchase page he can see all the products he added in shopping cart in his last visit.

    2) personalized sites: when user visits certain pages they are asked which pages they don’t want to visit or display. User options are get stored in cookie and till the user is online, those pages are not shown to him.

    3) user tracking: to track number of unique visitors online at particular time.

    4) marketing: some companies use cookies to display advertisements on user machines. Cookies control these advertisements. When and which advertisement should be shown? what is the interest of the user? which keywords he searches on the site? all these things can be maintained using cookies.

    5) user sessions: cookies can track user sessions to particular domain using user id and password. Drawbacks of cookies:

    1) even writing cookie is a great way to maintain user interaction, if user has set browser options to warn before writing any cookie or disabled the cookies completely then site containing cookie will be completely disabled and can not perform any operation resulting in loss of site traffic.

    2) too many cookies: if you are writing too many cookies on every page navigation and if user has turned on option to warn before writing cookie, this could turn away user from your site.

    3) security issues: some times users personal information is stored in cookies and if someone hack the cookie then hacker can get access to your personal information. Even corrupted cookies can be read by different domains and lead to security issues.

    4) sensitive information: some sites may write and store your sensitive information in cookies, which should not be allowed due to privacy concerns. This should be enough to know what cookies are. If you want more cookie info see cookie central page. Some major test cases for web application cookie testing: the first obvious test case is to test if your application is writing cookies properly on disk. You can use the cookie tester application also if you don’t have any web application to test but you want to understand the cookie concept for testing.

    Thanks
    deepasree

    Last edited by deepasree; 08-18-2008 at 08:53 AM.

  3. #3
    Contributing Member
    Join Date
    Aug 2008
    Answers
    31

    Re: Coockie testing

    Quote Originally Posted by deepasree View Post
    Hi friend
    . You can use the cookie tester application also if you donít have any web application to test but you want to understand the cookie concept for testing.
    Thanks
    deepasree

    now i hv understood abt cookies....but for BASIC level what i hv to check in my project for cookies testing


  4. #4
    Expert Member
    Join Date
    Apr 2008
    Answers
    1,859

    Re: Coockie testing

    hi friend..

    just where your cookies are relayed and then test

    thanks
    Deepasree


  5. #5
    Junior Member
    Join Date
    Aug 2008
    Answers
    3

    Re: Coockie testing

    Thank for your valuable answer


  6.  Sponsored Ads
    Ad


     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact