Without that cookie, the session cannot be retrieved and a new
session will be generated on each request. To our misfortune, not all mobile devices
support cookies. And if they do, they also have restrictions on the maximum number
of cookies or length of each cookie. There is a good enough reason behind this!
Mobile devices have limited storage and processing capacity. A cookie stores data in
text format at the client end. Cookies for a particular URL are sent with each request
Building Pizza On The Run
[ 60 ]
to that URL??”which may not be feasible for a tiny browser. Most of today's mobile
browsers support cookies, but some need a WAP gateway between the client and the
server for cookies. The WAP gateway acts as a smart proxy??”managing cookies and
any other information for the client.
We have two alternatives to deal with this. One, to support only browsers that can
accept cookies, and two, to remove the use of cookies in our application. Luigi does
not want to eliminate any users, so wants us to handle user sessions on our own.
(He never goes the easy way!)
Thankfully, we can still use PHP sessions. PHP works with session IDs stored
in cookies or passed as a request parameter.
Pages:
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96