Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What is the different between cookies and session in php?

Answers were Sorted based on User's Feedback



What is the different between cookies and session in php?..

Answer / deepak nagar

session is always use to maintain the state b/w browser and
the WEB server, HTTP is stateless which doesnt know about
the users,session is powerfull enemy of ststeless..
Cookie stored a client end and this is the queation pn the
security...

Is This Answer Correct ?    5 Yes 3 No

What is the different between cookies and session in php?..

Answer / ankit

A cookie can keep information in the user's browser until
deleted. If a person has a login and password, this can be
set as a cookie in their browser so they do not have to
re-login to your website every time they visit. You can
store almost anything in a browser cookie. The trouble is
that a user can block cookies or delete them at any time.
If, for example, your website's shopping cart utilized
cookies, and a person had their browser set to block them,
then they could not shop at your website.
Sessions are not reliant on the user allowing a cookie. They
work instead like a token allowing access and passing
information while the user has their browser open. The
problem with sessions is that when you close your browser
you also lose the session. So, if you had a site requiring a
login, this couldn't be saved as a session like it could as
a cookie, and the user would be forced to re-login every
time they visit. You can of course get the best of both
worlds! Once you know what each does, you can use a
combination of cookies and sessions to make your site work
exactly the way you want it
The difference between sessions and cookies is that a
session can hold multiple variables, and you don’t have to
set cookies for every variable. By default, the session data
is stored in a cookie with an expiry date of zero, which
means that the session only remains active as long as the
browser. When you close the browser, all the stored
information is lost. You can modify this behavior by
changing the “session.cookie_lifetime” setting in “php.ini”
from zero to whatever you want the cookie lifetime to be.
session_start(); //starts or resumes a function
session_destroy(); //ends the session; comment this line and
the browser will output the same session ID as before If you
want to remove the registered variables, you need to use the
session_unset() function.

Is This Answer Correct ?    2 Yes 0 No

What is the different between cookies and session in php?..

Answer / ekta aptel

1.Cookies are stored in client side.
Session are stored in server side.
2.Cookies stored limited amount of data.
Session stored unlimited amount of data.
3.Cookies can only store string. Session can store object.
4.We could be save cookie for future reference but session
couldn't. When user close their browser, they also lost the
session.
5. Cookies quite faster than a session.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More PHP Interview Questions

How to receive a cookie from the browser?

0 Answers  


How can we check the value of a given variable is a number?

0 Answers  


How does firefox manage cookies?

0 Answers  


How to convert a timezone from one to another ?

1 Answers  


How can I maintain the count of how many persons have hit my site?

1 Answers   MTOG, Rushmore Consultancy,


Which array function checks if the particular key exists in the array?

0 Answers  


How can I find what type of images that the PHP version supports?

1 Answers  


Write syntax to open a file in php?

0 Answers  


Explain the syntax for ‘foreach’ loop with example.

0 Answers  


What is the function used to change the root directory in PHP?

0 Answers  


How to read one character from a file?

0 Answers  


What is The difference between ' and " where they can ben in between or outmost and how

2 Answers   Avis Software,


Categories