Page 1 of 1

How to log in a user based on session?

Posted: Sun Mar 14, 2010 6:58 am
by DelvarWorld
I am using phpbb as my site's authentication system. I am also using a Flash file uploader to pass a file to the server. Of course when Flash posts it doesn't have the same cookies as the user so I am manually passing the session id but it doesn't seem to log in the user. Basically I am doing this:

1. Page with upload form and swf. User is authenticated on this page the normal way (except maybe session_start):

Code: Select all

session_start();
define('IN_PHPBB', true);
$phpbb_root_path = HTML_ROOT.'/frm/'; 
$phpEx = 'php';
include($phpbb_root_path . 'common.php');
$user->session_begin();
$auth->acl($user->data);
$user->setup();
2. the upload form posts the file, and the output of session_id() as, say, "phpsid"

3. Receiving form sets that session id and attempts to authenticate again:

Code: Select all

if($_POST['phpsid']) {
     session_id($_POST['phpsid']);
}
session_start();
define('IN_PHPBB', true);
$phpbb_root_path = HTML_ROOT.'/frm/'; 
$phpEx = 'php';
include($phpbb_root_path . 'common.php');
$user->session_begin();
$auth->acl($user->data);
$user->setup();
But setting the sid on the receiving page doesn't work, it sees the user as anonymous after authenticating. Can I log in a user with this method? It's using swfupload, where if the session needs to be passed that's the way you do it, post it then set it with session_id on the receiving page. Does not seem to work with phpbb's authentication system. Is there a similar solution?

Re: How to log in a user based on session?

Posted: Mon Mar 15, 2010 9:18 pm
by DelvarWorld
gggooonnnaaaaa bumpthis

edit: sorry if this was an early bump, didn't notice that it had been moved

Re: How to log in a user based on session?

Posted: Thu Mar 18, 2010 1:58 am
by DelvarWorld
Now THIS is what I'd call a valid bump

Re: How to log in a user based on session?

Posted: Sun May 09, 2010 7:52 pm
by DelvarWorld
BLUMPKIN