Results 1 to 8 of 8

Thread: Why cookies required?

  1. #1
    Moderator
    Join Date
    Sep 2006
    Answers
    920

    Thumbs up Why cookies required?

    hey,

    will anyone answer me

    "Why cookies required?"

    Regards,
    Brijesh Jain
    ---------------------------------------------------------
    Connect with me on Skype: jainbrijesh
    Google Plus : jainbrijeshji

  2. #2
    Contributing Member
    Join Date
    Feb 2007
    Answers
    48

    Re: Why cookies required?

    web objects are state-less and hence we require some storage variables to persist some info like loginid, etc. These variable may be either cookies or session variables. Cookies will be stored in client's machine where as session variables will be stored in the server. both have their own merit and demerits.


  3. #3
    Moderator
    Join Date
    Sep 2006
    Answers
    920

    Re: Why cookies required?

    Cookies are commonly used to "maintain the state" of the session as a user browses around the site. The shopping cart is an example. You can place an item in the cart, switch to another page or even another site, and when you come back, the site knows who you are, and you can continue with the order. Without cookies, the site would not be able to identify you automatically because the Internet is "stateless."

    Regards,
    Brijesh Jain
    ---------------------------------------------------------
    Connect with me on Skype: jainbrijesh
    Google Plus : jainbrijeshji

  4. #4
    Contributing Member
    Join Date
    Sep 2006
    Answers
    962

    Re: Why cookies required?

    If you are not using cookies then you cann't manage security with full of speed. If cookies are not used then everytime you must ask the user to enter your username and password. if you do like this then user irritate with your site and simply colse the site.


  5. #5
    Junior Member
    Join Date
    Mar 2007
    Answers
    2

    Re: Why cookies required?

    Hi All,

    Cookies are short pieces of data used by web servers to help identify web users. The popular concepts and rumors about what a cookie can do has reached almost mystical proportions, frightening users and worrying their managers.

    Hope this helps!

    Vaseem


  6. #6
    Contributing Member
    Join Date
    Feb 2007
    Answers
    48

    Re: Why cookies required?

    Hi Sridevi,

    Thanks for providing good info.

    Regards,
    Ganesh


  7. #7
    Expert Member
    Join Date
    Oct 2005
    Answers
    383

    Re: Why cookies required?

    hi jain
    cookies are a concept which helos u in session tracking! servlet runs on a request and response method.As u know that HTTP is a stateless protocol.(stateless means it doesnot remeber the client),so there should b some method to keep track of client when requests are geneated.
    cookie is temporary data file stored in client machine!it is stored in client m/c !cookie comes with response from server!
    but cookies are not that useful since client has the option to disbale it!Even there are security issues with it!
    So in server side programming we generally use Session!
    hope i am clear!
    bye

    Last edited by vmshenoy; 03-17-2007 at 01:50 AM.
    :)
    NEVER SAY DIE.

  8. #8
    Junior Member
    Join Date
    Feb 2009
    Answers
    3

    Re: Why cookies required?

    Both cookies and sessions are available to you as a PHP developer, and both accomplish much the same task of storing data across pages on your site. However, there are differences between the two that will make each favourable in their own circumstance.

    Cookies can be set to a long lifespan, which means that data stored in a cookie can be stored for months if not years. Cookies, having their data stored on the client, work smoothly when you have a cluster of web servers, whereas sessions are stored on the server, meaning in one of your web servers handles the first request, the other web servers in your cluster will not have the stored information.

    Sessions are stored on the server, which means clients do not have access to the information you store about them - this is particularly important if you store shopping baskets or other information you do not want you visitors to be able to edit by hand by hacking their cookies. Session data, being stored on your server, does not need to be transmitted with each page; clients just need to send an ID and the data is loaded from the local file. Finally, sessions can be any size you want because they are held on your server, whereas many web browsers have a limit on how big cookies can be to stop rogue web sites chewing up gigabytes of data with meaningless cookie information.

    So, as you can see, each have their own advantages, but at the end of the day it usually comes down one choice: do you want your data to work when you visitor comes back the next day? If so, then your only choice is cookies - if you have any particularly sensitive information, your best bet is to store it in a database, then use the cookie to store an ID number to reference the data. If you do not need semi-permanent data, then sessions are generally preferred, as they are a little easier to use, do not require their data to be sent in entirety with each page, and are also cleaned up as soon as your visitor closes their web browser.


  9.  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