

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A part of the csci 2910 client/server-side programming course materials. It covers the topic of sessions in php, explaining their purpose, mechanics, implementation, and variable types. Sessions are essential for managing complex interactions with clients, such as shopping carts, secure sites, and user settings. Examples of starting, stopping, and using session variables, as well as handling session variable types.
Typology: Study notes
1 / 3
This page cannot be seen from the preview
Don't miss anything!


CSCI 2910 – Client/Server-Side Programming Sessions in PHP – Page 1 of 13
Topic: Sessions in PHP Reading: Williams & Lane pp. 338-
CSCI 2910 – Client/Server-Side Programming Sessions in PHP – Page 2 of 13
Today’s lecture will cover:
CSCI 2910 – Client/Server-Side Programming Sessions in PHP – Page 3 of 13
CSCI 2910 – Client/Server-Side Programming Sessions in PHP – Page 5 of 13
CSCI 2910 – Client/Server-Side Programming Sessions in PHP – Page 6 of 13
CSCI 2910 – Client/Server-Side Programming Sessions in PHP – Page 7 of 13
if (!isset( $_SESSION['quantity'] )) $_SESSION['quantity'] = 0; else $_SESSION['quantity']++;
CSCI 2910 – Client/Server-Side Programming Sessions in PHP – Page 8 of 13
CSCI 2910 – Client/Server-Side Programming Sessions in PHP – Page 9 of 13
CSCI 2910 – Client/Server-Side Programming Sessions in PHP – Page 10 of 13
CSCI 2910 – Client/Server-Side Programming Sessions in PHP – Page 11 of 13
Hello, World! in PHP
CSCI 2910 – Client/Server-Side Programming Sessions in PHP – Page 12 of 13
If you receive a signal from the client that they are ending the session, e.g., clicking on a link to log out, there is a method you can use to force a session to end.