Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

2 questions on Sessions and Cookies

Status
Not open for further replies.

PeterMac

Programmer
Mar 9, 2001
51
0
0
CA
OK... here is the first one...

what is the difference between a session and a cookie ? The php documentation states that sessions are managed thru cookies... so why use the $_SESSION as opposed to a cookie?

question 2

I have a site that uses cookies... my local environment allows for me to set the tools->internet options->privacy setting to medium and the cookies are served fine. However when I upload my code and run it on the "production" server I have to set that privacy level to low in order for those cookies to be served. Can anyone tell me what settings may be causing this behvaiour? I have register globals set on in both cases. Could there be some settings in Apache that also control cookies ?

Any help appreciated.
 
1.The PHP session system does not actually store your data in the session cookie it sets. Rather, (by default) it writes the data to a temporary directory in a file, then sets the session cookie's value to something it can use to find that file again.

By use of this redirection, you can store a lot more information in a session than in a cookie.


2. More than likely, your production server and test server are interpreted by IE to be in two different security zones.

Want the best answers? Ask the best questions: TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top