Forum Moderators: coopster

Message Too Old, No Replies

Cookies or global variables?

What is better?

         

GreenLeaf

1:45 pm on Aug 24, 2004 (gmt 0)

10+ Year Member



Hi!
I'm a total newbie in PHP and have a little question:
if, for example, i need a couple of variables for my site/page, what would be better: to set up them as cookies (this doesn't work for first page load, only for second one) or simply set them up as global variables and call them when i'll need them?
What are the cookie's advantages as compared to plain global variables?
Thanks in advance.

jatar_k

5:48 pm on Aug 24, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



what exactly are you trying to store?
is it something that the user will select?
is it something that your scripts can determine with out user interaction?

GreenLeaf

6:48 pm on Aug 24, 2004 (gmt 0)

10+ Year Member



Example: i need to fix user's country for future use in sql query.