Re: session cross between users? SOLVED!
| From: | Justin Patrin | Date: | Mon, 22 Nov 2004 17:26:05 +0000 |
| Subject: | Re: session cross between users? SOLVED! | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-15757@lists.php.net to get a copy of this message | ||
On Mon, 22 Nov 2004 10:57:11 +0100, Leo Márquez <leo@calidae.net> wrote:
> Hi again!,
>
> The problem is solved. It was a problem with Smarty and caching.
> Probably a Smarty bug?
> We have a page as product.php which have to show a product. The urls
> from differents users can be:
>
> product.php?id=334
> product.php?id=256
>
> Smarty catch the page from the first user (the faster) and serve the
> same page to the second. Smarty has not consideration to the
> querystring parameter?
> This list is not the place to ask it but I was needed to explain the
> end of this thread that has taken part a few persons.
> We have deactivated the caching os Smarty and the application works
> fine.
>
Aha.....
Well, that's your problem. If you cache the HTML output of a Smarty
template this will always happen. Smarty does not use the URL for
caching, it uses just the page name. I believe it has some built-in
mechanisms for caching specific instances of pages, but I'm not sure.
The answer is to turn off HTML caching. You should still cache the
compiled templates, of course (this will make your page run no slower
than a normal PHP page). If you *really* want HTML caching, you should
be turning it off on any template which has dynamic content
per-request.
--
Justin Patrin