How to log in a user based on session?

Discussion forum for MOD Writers regarding MOD Development.
Locked
DelvarWorld
Registered User
Posts: 203
Joined: Thu Sep 04, 2003 10:56 pm
Location: noplarbp

How to log in a user based on session?

Post 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?
Last edited by stickerboy on Sun Mar 14, 2010 2:02 pm, edited 1 time in total.
Reason: Moved to MOD Writers
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
DelvarWorld
Registered User
Posts: 203
Joined: Thu Sep 04, 2003 10:56 pm
Location: noplarbp

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

Post by DelvarWorld »

gggooonnnaaaaa bumpthis

edit: sorry if this was an early bump, didn't notice that it had been moved
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
DelvarWorld
Registered User
Posts: 203
Joined: Thu Sep 04, 2003 10:56 pm
Location: noplarbp

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

Post by DelvarWorld »

Now THIS is what I'd call a valid bump
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
DelvarWorld
Registered User
Posts: 203
Joined: Thu Sep 04, 2003 10:56 pm
Location: noplarbp

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

Post by DelvarWorld »

BLUMPKIN
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Locked

Return to “[3.0.x] MOD Writers Discussion”