Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4
Like Tree3Likes
  • 1 Post By mlseim
  • 1 Post By tanzil.chauhan

Thread: What is the difference between Session and Cookie?

  1. #1
    Member
    Join Date
    Feb 2017
    Location
    India
    Posts
    34
    Member #
    56118
    Liked
    2 times

    What is the difference between Session and Cookie?

    Difference between Session and cookie and What are the importance of session and cookie in php.

  2.  

  3. #2
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,686
    Member #
    5580
    Liked
    716 times
    Cookies are information stored on the users computer that can only be accessed by the domain that put them there. Created, written, read and deleted by javascripting or server side languages such as PHP. The owner of the computer can find them on their harddrive and view them and delete them.

    Sessions are similar to cookies, but stored on the webhost server. The user's computer/browser does get a session id key, but no other data. The session stays active only while the browser stays open or until the session times out ... determined by the webhost configuration. The user can leave the website and come back and the session will still be active as long as they did not close their browser, because the session id key will be lost. They are more secure than cookies because the data they contain remains on the website, and is deleted when the session closes.

    Cookies can be permanent, sessions are temporary.
    Last edited by mlseim; Feb 11th, 2017 at 10:54 AM.
    apptunix1 likes this.


  4. #3
    Junior Member
    Join Date
    Feb 2017
    Location
    Ahmedabad
    Posts
    14
    Member #
    56102
    Liked
    4 times
    Hi,

    - A cookie is a bit of data stored by the browser and sent to the server with every request.
    A session is a collection of data stored on the server and associated with a given user (usually via a cookie containing an id code)


    - Also session values are reset after the connection is closed. Cookies values are normally saved.

    Thanks,
    apptunix1 likes this.

  5. #4
    Member
    Join Date
    Feb 2017
    Location
    India
    Posts
    34
    Member #
    56118
    Liked
    2 times
    Thanks a lot for providing me a informative information


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 05:27 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com