Question re Session URL re-writing

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I have developed a website that uses Sessions to manage user
state. It has come to my attention that the users that will be using
this site do not want to enable cookies on their machines. The IT
department is refusing to do it and the individual users do not know
how. We are looking at either emailing howto's out to all the users
along with the already posted instructions that are on the website.
However I was thinking about using URL-rewriting to pass the session_id
instead of relying on cookies. So my question is....

On my site, which is a survey, I don't have links (i.e. hrefs), I
simply call functions when a user answers a question or goes back to
a previous question. For example;

Lets say you answer question 1 the program calls processQ.php,
processQ then works with the answer and, when finished, calls qDisplay()
which is part of a class called Survey.php to display the next question.
There are no links with which to send the session_id on. Is there anyway
to just pass the session_ID as a parameter to the function qDisplay(), for
example qDisplay($SID) or whatever or is using cookies the only way that
I can propagate user sessions?

Sorry for the looooong post. Thanks in advance.


Re: Question re Session URL re-writing

Dave Cooke wrote:
Quoted text here. Click to load it

Your functions shouldn't need to know the session id. As long as the SID
is passed to the main script then the session is retrieved and your
functions can use the session contents. If you turn on
session.use_trans_sid then php should do all tis for you.

As a long term fix though your users should at the very least have
cookies turned on even if they're not persistent. Many sites rely on

Site Timeline