What Are Session Functions?

Session functions implement a concept you have already seen. That is the provision to users of a unique identifier, which can then be used from access to access to acquire information linked to that ID. The difference is that most of the work is already done for you. When a user accesses a session-enabled page, she will either be allocated a new identifier or reassociated with one that has already been established for her in a previous access. Any variables that have been associated with the session become available to your code. If the php.ini register _globals directive is set, session data becomes available in the global namespace. Otherwise, you can access them through the superglobal $_SESSION associative array. ...

Get Sams Teach Yourself PHP in 24 Hours, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.