[development] forms without session
Rob Barreca
rob at electronicinsight.com
Mon Oct 15 07:32:38 UTC 2007
Dave Cohen wrote:
> I have a situation in which I can't preserve any session information for my
> users. No cookies are available. I'm able to present pages OK, but all form
> submissions fail.
>
Funny you posted this. I was about to post something myself for Facebook
apps using FBML (this is a non-issue if you use IFRAME option for FB apps).
So if we turn off form token validation using the following form_alter
and hacking #action in system.module (probably a non-hack way to do
this), I can get forms to submit and save data while in FBML mode. But,
at least on user/x/edit I get a FB canvas page trying to load a FB login
page as FBML, probably from something getting weird on redirect.
Dave, let's connect on Skype sometime this week (SN: schoolengine) as
I'm gearing up to do my next app and want to get it all FBML instead of
using IFRAMEs and would like to merge our FB module code and get this
stuff solid.
> /**
> * Implementation of hook_form_alter().
> *
> * Turns off form token validation since for Facebook apps using FBML
> * all requests come from Facebook's servers.
> */
> function facebook_app_form_alter($form_id, &$form) {
> unset($form['#token']);
> }
> function system_elements() {
> // Top level form...just testing FB hack
> $type['form'] = array('#method' => 'post', '#action' =>
> '/myappname'. request_uri());
-Rob
More information about the development
mailing list