[[misc:use_trans_sid]]
Language: Deutsch · English

Disable "use_trans_sid" in PHP

See also: http://www.mtdev.com/2002/06/why-you-should-disable-phps-session-use_trans_sid

If one opened a page in my wiki through an external link, like Mini-HOWTO for OpenVPN with FLI4L, all links on that page contained the additional parameter "?DokuWiki", followed by a longer combination of numbers and characters. First i assumed this to be a feature of DokuWiki, until i looked at the code of DokuWiki.

DokuWiki creates a PHP session with session_start(). Usually, a cookie with the name "PHPSESSID" will be used to store the generated session ID. Well - DokuWiki also changes the name of the session to "DokuWiki", so the cookie for the session ID is named "DokuWiki".

It may happen, that PHP assumes, that it is not possible to transmit cookies and adds the session ID as an additional parameter to all links and as additional hidden fields in forms - which can cause a number of problems. This can be controlled by the configuration setting "use_trans_sid".

In my case, i could use an additional section in the file .htaccess, which is already used to make "nice" URLs possible:

<IfModule mod_php4.c>
php_value session.use_trans_sid 0
</IfModule> 
(processing time: 0.20 sec)