Page 1 of 1

Server settings for sessions

Posted: Tue Nov 08, 2005 4:32 pm
by Luke
OK, this is related to my last question, but it's not the same...
I have a server running locally on my machine, and when I run this script with cookies turned off, the num_visits variable does not incremint, and the SID is not appended to the URI automatically. When I run it on my host's server, it does incrment, and it does append the SID... what php.ini value would cause this behavior?

Code: Select all

<?php
session_start();

if(!isset($_SESSION['num_visits'])){
	$_SESSION['num_visits'] = 0;
}
$_SESSION['num_visits']++;
print_r($_SESSION);
echo SID;
?>
<a href="session.php">Link</a>

Posted: Tue Nov 08, 2005 5:24 pm
by Luke
is it maybe this one?

session.use_trans_sid = 0

Posted: Tue Nov 08, 2005 5:28 pm
by s.dot
session.use_trans_sid boolean
session.use_trans_sid whether transparent sid support is enabled or not. Defaults to 0 (disabled).

Note: For PHP 4.1.2 or less, it is enabled by compiling with --enable-trans-sid. From PHP 4.2.0, trans-sid feature is always compiled.

URL based session management has additional security risks compared to cookie based session management. Users may send a URL that contains an active session ID to their friends by email or users may save a URL that contains a session ID to their bookmarks and access your site with the same session ID always, for example.
Set it to 1 and try it 8)

Posted: Tue Nov 08, 2005 5:31 pm
by Luke
lol... yea, I guess I could have done that before asking. haha. OK that's the one.

:: shoots self for own stupidity ::