Oops... Meant to send this out yesterday, but it got stuck in my drafts
folder...
I finally figured the problem--though I can't explain it fully. I post this
here for those who might be having the same problem getting forms to work
with cleanurls.
I had this line in my skin which somehow didn't work with my rewrite rules
<body background='files/skin/background.gif'>
So I changed it to the full cleanurl, using {field}, ie:
<body background='{field}/files/skin/space.gif'>
And now BoltWire is happy. I did this with other things in my skin as well
(images and css files), but missed this one and evidently it affected my
session handling. Have been using it since with cleanurls and all seems
good.
Cheers,
Dan
P.S. Fuller explanation on reflection: When I output the page to the
browser--it must have immediately placed a call for the background.gif,
which the rewrite rules reinterpreted as a call to a BoltWire page, which
reset the form key to numbers for that request, and the form keys of the
actual page got overwritten. Thus, by the time the rest of the page was
loaded, the keys were no longer valid. Makes perfect sense actually...
I noticed the same thing in the default skin--where I didn't have a
background image, but I did have a call to the BoltWire favicon. It blocked
forms from functioning until I replaced it with a call to {field}/files...
So I fixed all three default skins (main, print, and mobile) for the next
release. But if you are having problems getting cleanurls to work--you will
need to check your skin html page for anything with a relative path. That
seems to be the culprit. (CSS pages seem ok).
P.P.S. I could have perhaps fixed it by adding the second rewrite cond to
my .htaccess file, rather than just using the first one, though I didn't
test it...
#RewriteRule ^field_directory/files/.*$ - [L]
#RewriteRule ^files/.*$ - [L]
On Thu, Mar 13, 2014 at 10:57 PM, The Editor <[email protected]> wrote:
> I've been working on a bug in BoltWire on and off for days and can't
> figure it out. Thought I would throw it out to the list to see if anyone
> has an idea...
>
> Near the very end of the engine script (before the utilities) after all
> the output for the entire page has been generated and store in a variable
> called $out I have these final 3 lines:
>
> p($_SESSION); // debugging here
> //echo($out); // should be uncommented
> exit();
>
> This always generates the correct $_SESSION variable, confirmed by this
> simple php script (called test.php) which I call in a separate browser
> window to verify my session value is set correctlly .
>
> <?php
> session_start();
> print_r($_SESSION);
> session_write_close();
> die();
>
> However, as soon as I uncomment the echo line something changes, and
> test.php gives me a completely different value. It acts as if something in
> the act of outputting the page messes up the session value--which shouldn't
> be as far as I can tell. If I wrap $out in htmlentities() it works again...
>
> Weirder still, if I do this
>
> p($_SESSION); // debugging here
> echo($out); // should be uncommented
> p($_SESSION); // more debugging here
> exit();
>
> The session value is correct in both instances. But when I check it in
> test.php the value is different again. Comment out the echo, and it works
> exactly as expected. I've also tried using print_r instead of echo. Same
> results.
>
> I have tried this numerous times.
>
> Curiously, the wrong session value is what would be produced if BoltWire
> constructed an action.missing page, but just printing the $out value
> shouldn't do that.
>
> I'm at a loss. Open to any ideas... This is very strange...
>
> Most likely the session info is getting stored in different locations
> somehow, or with different id's, though I'm not sure why. I'm also
> tinkering with cleanURL's which seem to have started this problem. It was
> also doing it before on one of my mobile skins--and I had to turn it off to
> get my forms to work. Any suggestions to this perplexer would be
> appreciated...
>
> Cheers,
> Dan
>
--
You received this message because you are subscribed to the Google Groups
"BoltWire" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/boltwire.
For more options, visit https://groups.google.com/d/optout.