开发者

php: use cookies only does't work

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜