You should definitely go for sessions. Sessions are far more reliable, maintain state better and are under your control. Cookies, on the other hand, are often completely ignored by the browser or lost in window closes and opens etc. Leaving data in cookies also creates significant security issues and calls for all sorts of complex filtering to sanitize the data sent by the user, before you even get to constructing your page.
To disable PHP session IDs in the URL, add this to a .htaccess file:
Quote:
php_value session.use_only_cookies 1
php_value session.use_trans_sid 0
|
Most recent builds of PHP should have this setting set already; I believe it's been the default for quite some time. If your web host is on an old build of PHP (especially PHP 4), you might want to consider switching to a newer host.
Edit: See
this article for more details.