Re: session or cookie
| From: | Steve Nelson | Date: | Fri, 10 Nov 2000 20:59:02 +0000 |
| Subject: | Re: session or cookie | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-24716@lists.php.net to get a copy of this message | ||
sessions are variables stored on the server, cookies are variables
stored in the browser. cookies have a limitation for how much
information they can store. I think it's around 4K per domain. So if
you need to store more information than that you're pretty much screwed
with cookies.
Cookies are slightly faster in that they do not hit the server as hard,
but at the same time if you use large cookies they add to the amount of
data that has to be downloaded, which slows things down a little.
The cool thing about session variables is that there is a unique
identifier to more data on the server, so the user cannot actually
change the data by editing their cookie file. At the very most they
could only change the identifier, which wouldn't really matter.
Even with the speed issues, use session vars, they're more flexible and
they add one more layer of security. :)
Steve Nelson
http://www.SecretAgents.com
Tools for Fusebox Developers
Mark Lo wrote:
>
> Hi,
>
> I would like to know what is the difference between session and
> cookies.
>
> Thank you
>
> Mark lo
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
--