well ... Now I know how to form the cookie but, when I make it, in WP and BBpress I'm not identified and can't login in bbpress.
This is my directory structure:
my-app/
+ bbpress/
+ wordpress/
|-my.php
|-app.php
|-files.php
My WordPress cookie integration speedup in bb-config.php
$bb->wp_siteurl = 'http://localhost/jb/v2.0.1/blog';
$bb->wp_home = 'http://localhost/jb/v2.0.1/blog';
$bb->cookiedomain = '';
$bb->cookiepath = '/jb/v2.0.1';
$bb->authcookie = 'wordpress_0c075535129bcbe9d6bcd335b9244e75';
$bb->secure_auth_cookie = 'wordpress_sec_0c075535129bcbe9d6bcd335b9244e75';
$bb->logged_in_cookie = 'wordpress_logged_in_0c075535129bcbe9d6bcd335b9244e75';
$bb->admin_cookie_path = '/jb/v2.0.1/foro/bb-admin';
$bb->core_plugins_cookie_path = '/jb/v2.0.1/foro/bb-plugins';
$bb->user_plugins_cookie_path = '/jb/v2.0.1/foro/my-plugins';
$bb->sitecookiepath = '/jb/v2.0.1/blog';
$bb->wp_admin_cookie_path = '/jb/v2.0.1/blog/wp-admin';
$bb->wp_plugins_cookie_path = '/jb/v2.0.1/blog/wp-content/plugins';
and the coockie:
$expiration = time() + 172800;
$expire = 0;
$cookie = generate_auth_cookie($expiration);
$domain = (empty($bb->cookiedomain)) ? $bb->cookiedomain : $bb->cookiedomain . '; HttpOnly';
setcookie($bb->logged_in_cookie, $cookie, $expire, $bb->cookiepath, $bb->cookiedomain, $secure);