I change the settings by ini_set("session.use_only_cookies", "1"); and ini_get returns the right value.
But it seems to make no difference, 开发者_JAVA技巧the sessionID is still added to the URLs on the page.
What could be wrong?
php version is 4.4.9
edit: Adding the line
ini_set ('url_rewriter.tags', '');
before session_start(); solved it!
Thanks guys!
According to http://es.php.net/manual/en/ini.list.php, in your php version, session.use_trans_sid could be changed at PHP_INI_PERDIR. According to http://es.php.net/manual/en/configuration.changes.modes.php, PHP_INI_PERDIR, you may change values only at php.ini, httpd.conf or .htaccess, but not via ini_set().
So, try to create a .htaccess file in the root of your PHP application with this line(if you are using apache):
php_value session.use_trans_sid On
BTW, consider upgrading to a newer version of PHP. PHP 4.x has been abandoned (not getting security updates) for a while now.
加载中,请稍侯......
精彩评论