As discussed a few months back, I'm interested attempting to recreate PHP's
enable_trans_sid feature, for users without cookies.

ONLY if cookies are UNavailable, I want to open the output buffer, build the
page, then run a reg exp or something over the output to append SIDs to all
URLs (GET), then print it.

I've got a pretty good picture in my head of how I'll test for cookies, and
how I'll do the output buffering, but regexp's are NOT my thing :)

I'm interested in hearing some opinions on the most efficient way to append
the SID to all internal URLs on the page... this would include:

- header("Location: something.php")
- <A href="something.php">
- <FORM action="something.php">

My thoughts are that it would only be done for relative links
(dir/something.php), NOT for fully qualified URLs (http://otherdomain.com,
ftp://, mailto:, https://, ?????), as per enable_trans_sid documentation.

It would also have to accommodate URLs which already have a query string...
if there's an existing query string, just append &SID, otherwise append

This seems to me like a rather in-depth regexp already, and I'm sure i'm
forgetting something.

Perhaps there's a simpler way that I'm missing?  The only simpler way I can
think of would be to search for '.php' and '.php?' and act accordingly, but
this has obvious problems when 'something.php' is type, but not in context
of a link or header redirection.

Where would I look to see the source of enable_trans_sid -- maybe this will
give me some hints??

Justin French

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

Reply via email to