By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,825 Members | 1,270 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,825 IT Pros & Developers. It's quick & easy.

Question re Session URL re-writing

P: n/a
Hi,

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.

Dave
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Dave Cooke wrote:
Hi,

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.

Dave


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
cookies.
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.