Click to See Complete Forum and Search --> : Session.


DanUK
11-22-2003, 02:00 PM
Hello there.
Is it possible to have sessionid attached to all pages loaded? All my href's attach the sessionid, but say if 'staff.php' is loaded directly, is tehre a way to get the sid attached? What would I need to add?

On my header.php I started the session via:


<?php
session_start();
if (eregi("header.php",$_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}

$header = 1;
?>


this is obviously loaded by all pages as header.php is included.
Thanks if you can help.

pyro
11-22-2003, 04:01 PM
Take a look at the following configuratives in the php.ini file:

session.use_trans_sid
url_rewriter.tags

http://us3.php.net/manual/en/ref.session.php
http://us3.php.net/manual/en/function.ini-set.php

DanUK
11-22-2003, 05:41 PM
Hello pyro.
Thanks for your reply.

Is there a way to achieve it without touching the php/apache configs? Or is this the only way?

Thanks in advance again!

pyro
11-22-2003, 05:42 PM
My second link (ini_set) is probably what you want.

DanUK
11-22-2003, 05:55 PM
Thanks, had a look and gathered the session.use_trans_sid -- but how would i use this in my php file to make it set session.use_trans_sid, couldn't find an example on that page ? :confused:

Is it something like:


<?php
ini_set('session.use_trans_sid','1')
?>

pyro
11-22-2003, 06:40 PM
Yes, I would think so. I've never had to use it, as of yet... ;)