Remove id session php


#1

Wed like to remove idsession from urls like http://telocompro.es/categoria-accesorios-animales-1957?PHPSESSID=d7b74b7733fbe3cf9be2d8d997551870

In our server the php is running as cgi so edit htaccess is unless.


#2

have you tried ini_set()?

track7 - my dream-hosted site


#3

id tried with

php_flag session.use_trans_sid off
php_flag session.use_only_cookies on

but this not work


#4

session.use_trans_sid is the setting you need to change, but as you already stated, you can’t change it in .htaccess with php running as cgi.

ini_set() exists so that you can change php.ini settings in php code when you can’t do it via .htaccess or directly editing php.ini

track7 - my dream-hosted site


#5

You actually can change it using htaccess and a custom php.ini and a simple shell script like this…

Your .htaccess

AddHandler php-cgi .php .htm 
Action php-cgi /cgi-bin/custom-php.cgi

Your /cgi-bin/custom-php.cgi

#!/bin/sh
export PHPRC=/home/username/askapache.com/inc
exec /home/username/askapache.com/htdocs/cgi-bin/php5.cgi

Then in your php.ini

with ini_set

Custom php.ini tips and tricks

Ultimate Apache htaccess // htaccess Help Forum