Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

Re: [moog] Identifying a user....

Quote Reply
Re: [moog] Identifying a user.... In reply to
Try:

my $session = $IN->cookie($CFG->{cookie_prefix} . 'session') || $IN->param('session');
my $remember = $IN->cookie('forum_hash_remember');
if ($session) {
$record = $DB->table('session')->select( { session_id => $session })->fetchrow_hashref;
}
elsif ($remember) {
$record = $DB->Table('remember')->select( { session_id => $remember} )->fetchrow_hashref;
}
if ($record) {
$user_id = $record->{session_user_id};
}
else {
# not logged in
}

That needs a bit of tweaking, but I hope you get the idea. Basically you just need to grab the session cookie like you do the remeber cookie. The only tricky part is you need the config object to figure out the name of the session cookie.

Cheers,

Alex
--
Gossamer Threads Inc.
Subject Author Views Date
Thread Identifying a user.... moog 1763 Sep 5, 2002, 5:00 AM
Thread Re: [moog] Identifying a user....
Alex 1717 Sep 5, 2002, 11:37 AM
Thread Re: [Alex] Identifying a user....
moog 1689 Sep 5, 2002, 1:36 PM
Thread Re: [moog] Identifying a user....
Alex 1690 Sep 5, 2002, 1:41 PM
Post Re: [Alex] Identifying a user....
moog 1662 Sep 6, 2002, 12:00 PM