> -----Original Message----- > From: David Eisenhart [mailto:[EMAIL PROTECTED]] > Sent: 31 May 2002 10:54 > > I am writing a function to construct page links within my > site; I want it to > append the session id to the URL's query string if the client does not > accept cookies (and ignore the session id if the client does accept > cookies). > > How do I detect if the client browser accepts cookies? > Indeed, has anyone got such a function as described above?
Yes -- and it's called PHP! The following is taken from the online manual page at http://www.php.net/manual/en/ref.session.php: The session module supports both methods. Cookies are optimal, but since they are not reliable (clients are not bound to accept them), we cannot rely on them. The second method embeds the session id directly into URLs. PHP is capable of doing this transparently when compiled with --enable-trans-sid. If you enable this option, relative URIs will be changed to contain the session id automatically. Alternatively, you can use the constant SID which is defined, if the client did not send the appropriate cookie. SID is either of the form session_name=session_id or is an empty string. Cheers! Mike --------------------------------------------------------------------- Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php