RU beehive logo ITEC dept promo banner
ITEC 325
2013spring
ibarland

homelectsexamshws
D2Lbreeze (snow day)

lect09c-session-concerns
sessions: practical issues

From PHP Visual Quickstart Guide by Larry Ullman
Originally based on notes by Jack Davis (jcdavis@radford.edu)

We have looked at how php includes session_start, which transparently gives you an array $_SESSION full of data from the last time the same person visited. Sessions are built on top of cookies.


1

In fact, it's conceivable that two different browsers might share cookies — e.g. Firefox and Mozilla intentionally using the same cookie directory. So your server-side code shouldn't really care/notice if the user manages to “migrate” a session from one browser to another; your server probably shouldn't store (say) the browser-type in $_SESSION, nor any other browser-specific info (at least, not info that it takes too seriously).

Besides, in that example (browser-type), the correct solution happens to be checking the http header's User-Agent field.

     

homelectsexamshws
D2Lbreeze (snow day)


©2012, Ian Barland, Radford University
Last modified 2013.Apr.01 (Mon)
Please mail any suggestions
(incl. typos, broken links)
to ibarlandradford.edu
Powered by PLT Scheme