Hi Rick,

I asked this same question to an ISP I'm with, and was told that it's only
possible through a re-compile. The way I got around it is this: I created a
function to check whether SID was present (it only is when the session is
first invoked, and from there on if the user doesn't have cookies enabled).
The function takes three arguments; type, url, and link text / image.
Here's how it looks:

// Function to auto append the session id to a link: takes the link and name
of link and
// the type of link (a=&, b=?) as arguments.
function AppendSessionId($link, $label, $type) {
 $display = "<a href=\"" . $link;
 if (SID) {
  if ($type == "a") {
   $display .= "&";
  } else
  if ($type == "b") {
   $display .= "?";
  $display .= SID;
 $display .= "\">" . $label . "</a>";

 return $display;

The type is for appending the SID onto links that already have a query
string. So if you did:

echo AppendSessionId("page.php?id=1", "Page 1", "a");

URL output would be:

If the user has cookies enabled, ouput would simply be:

If you use type "b", then the sid is appended with a question mark (new
query string is started) for those users without cookies enabled:

echo AppendSessionId("page.php", "My page", "b");

output would be:
page.php for cookies enabled users and
page.php?session_id_variable_name=23456789 for those who cause us problems.

Hope that helps. If anyone's got a better solution, I'm all ears! :)


"Richard Baskett" <[EMAIL PROTECTED]> wrote in message
Is there any other way of enabling trans_sid besides when compiling php?
Can I enable it in the php.ini file or .htaccess? And if so what would the
syntax be?  I've tried multiple things, but nothing seems to work..

If that's not possible is there a way of getting rid of the '?' in the url
when people have cookies enabled?  When cookies are not enabled the sid will
follow the '?' in the url since currently all my links have <?=sid?> at the
end.. So for example:

<a href="login.htm?<?=sid?>">Please login</a>

As you can see there will always be the '?' at the end of login.htm.. When
the surfer has cookies off it doesnąt look bad, but when he has them
enabled.. It just looks strange :)



"A good head and good heart are always a formidable combination. But when
you add to that a literate tongue or pen, then you have something very
special" - Nelson Mandela

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to