Server settings for sessions

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Server settings for sessions

Post 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>
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

is it maybe this one?

session.use_trans_sid = 0
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post 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)
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

lol... yea, I guess I could have done that before asking. haha. OK that's the one.

:: shoots self for own stupidity ::
Post Reply