Re: emulating enable_trans_sid
| From: | Tom Rogers | Date: | Mon, 01 Jul 2002 05:36:36 +0000 |
| Subject: | Re: emulating enable_trans_sid | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-104630@lists.php.net to get a copy of this message | ||
Hi
Ok probably the easiest is just to add <?if(!empty(SID) echo 'sid='.SID?> to the end of each url, if cookies are supported SID will be an empty string.
Tom
At 01:59 PM 1/07/2002 +1000, you wrote:
I'm aware of this. What I'm trying to do is emulate this process on servers which have not compiled with --enable_trans_sid. I thought that was pretty clear, but perhaps not. In the ideal world, enable_trans_sid would have been compiled, but I'm yet to find many shared hosts where this has been done. And since shared servers seem to be what my current client set are using, I'm looking at emulating enable_trans_sid. Regards, Justin French on 01/07/02 1:07 PM, Tom Rogers (trogers@kwikin.com) wrote: Hi enable_trans_sid does exactly what you are trying to re create, if no cookies are available it modifies all the urls automatically. and transparently Tom At 12:48 PM 1/07/2002 +1000, Justin French wrote:PHP'sHi, As discussed a few months back, I'm interested attempting to recreatebuild theenable_trans_sid feature, for users without cookies. ONLY if cookies are UNavailable, I want to open the output buffer,to allpage, then run a reg exp or something over the output to append SIDscookies, andURLs (GET), then print it. I've got a pretty good picture in my head of how I'll test forappendhow 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 tostring...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 queryI canif there's an existing query string, just append &SID, otherwise append ?SID. 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 wayaccordingly, butthink of would be to search for '.php' and '.php?' and actwillthis 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-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpgive me some hints?? Justin French -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php