Topic: punBB 1.3 external login

hello,
i read many post about punBB 1.3 integration, but i don't find any working solution. I wont to make our login form and autologin to forum by setting cookie. For testing i put data from database manually So i used that code:

define (FORUM_ROOT, 'forum/');
require_once FORUM_ROOT.'include/common.php';
$user_id = 'gokiux';
$form_password = '12345';
$salt = 'YsxR\cDvTy!#';   //salt is too from table users
$form_password_hash = forum_hash($form_password, $salt);
$expire = ($save_pass) ? time() + 1209600 : time() + $forum_config['o_timeout_visit'];
forum_setcookie($cookie_name, base64_encode($user_id.'|'.$form_password_hash.'|'.$expire.'|'.sha1($salt.$form_password_hash.forum_hash($expire, $salt))), $expire);

what i'm doing wrong?

Re: punBB 1.3 external login

Describe what you want to do in more detail, please. Do you want to autologin a user to the forum, when that user logins to your site?

Re: punBB 1.3 external login

yes, exactly. I need to make autologin. for 1.2 version are many examples and for 1.3 version i dont find any working example

Re: punBB 1.3 external login

so maybe can sombody help me?

Re: punBB 1.3 external login

Check out cookie values after setting it with script, that you have posted above (domain and path)

Re: punBB 1.3 external login

path is '/' and domain is empty. that script is in root, and punbb is in forum/. all includes is good, in that same page i print $forum_user['username'], after login in punbb login form, it print username, but after i set cookies in my page, it print guest

Re: punBB 1.3 external login

gokiux wrote:

path is '/' and domain is empty. that script is in root, and punbb is in forum/. all includes is good, in that same page i print $forum_user['username'], after login in punbb login form, it print username, but after i set cookies in my page, it print guest

I think that happens because the PunBB cookie is specific that the user/pass login you did in /forum/ is for /forum/ and not /.  I have the same issue with subdomains, and I have your same problem of being rather confused how to use PunBB login externally.

I'm digging through the code right now and will advise as I find solutions.