O'Reilly logo

PHP for Teens by Maneesh Sethi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

PHP Functions for Session Data

Sessions are great tools for passing variables on your web site, but there is a possible problem. You can get into trouble if two scripts use variables of the same name. When Programmer A develops his web page, he creates a form where the user can enter his information to ship an item. He calls this session variable $name. Programmer B, who is an amateur PHP developer, decides to create a page in which $name tracks the user’s name. Well, if a visitor goes to the page developed by Programmer A, and then he goes to the second page developed by Programmer B, the $name variable is tracked and perhaps unchangeable. This can be a problem because we don’t want both users getting mixed up without letting the user know that ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required