MyBB Community Forums

Full Version: Mybb cookie modification
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I wanted my custom made portal to be able to somehow run on the mybb cookie, so users logged on the forum will also be logged on the portal.
I noticed there is already such a modification on a topic here, allowing mybb integration with other scripts, but due to the cookie settings, it doesn't work for me.
So I added this code on the index.php page of the forum:

/*cookie setat pentru portal*/
$valori = explode("_", $_COOKIE['mybbuser']);
$portal_uid = $valori[0];
setcookie ("portal_login", $portal_uid, time()+72000, '/', '.mysite.com');
/*end */

The modification works, I am able to use on the portal the portal_login cookie. However, my question is about the safety of what I did. Is it at least a bit secure? I'm not that good with cookies but I don't see anything harmful there, since it only stores the uid of the user.

And as a second question.. is there anyway I could have done this in a more.. elegant manner? Big Grin