Re-starting a joomla session (1.0.x)
Posted: Wed Oct 24, 2007 8:12 pm
I'm developing a component that allows upload of pictures via a flash plugin. I tried to get some of my questions anwered in another a subforum without luck, so I'll try to narrow it down a little bit.
When uploading the file, the flash plugin does not transmit session/cookie data so there is no way by default to detect who is doing what. So I need some other method of keeping check on sessions.
What I have been doing is using the following function (from Virtuemart) to get the current session id stored in #__session table:
I transmit the md5() of this value along with the user id in the calling URL and on the receiving end check them against the md5 of the session value and userid stored in the #__session table. If they match up, then this user is logged in, and processing can continue.
The above method that I have developed works fine in Firefox, Opera and Safari, but not in IE. Does anyone know why?? For some reason, IE logs you out after you have uploaded the file(s). My question is:
1) Is there a way to restart a session?
2) What information is needed to do this, and where do I find it?
Ford
When uploading the file, the flash plugin does not transmit session/cookie data so there is no way by default to detect who is doing what. So I need some other method of keeping check on sessions.
What I have been doing is using the following function (from Virtuemart) to get the current session id stored in #__session table:
Code: Select all
function getSessionId() {
global $mainframe;
if( is_callable( array( 'mosMainframe', 'sessionCookieName')))
{
// Joomla >= 1.0.8
$sessionCookieName = mosMainFrame::sessionCookieName();
$sessionCookie = mosGetParam( $_COOKIE, $sessionCookieName, null );
return mosMainFrame::sessionCookieValue( $sessionCookie );
}
elseif( is_callable( array('mosSession', 'getCurrent' )))
{
// Mambo 4.6
$session =& mosSession::getCurrent();
return $session->session_id;
}
elseif( !empty( $mainframe->_session->session_id ))
{
// Mambo <= 4.5.2.3 and Joomla <= 1.0.7
return $mainframe->_session->session_id;
}
}
I transmit the md5() of this value along with the user id in the calling URL and on the receiving end check them against the md5 of the session value and userid stored in the #__session table. If they match up, then this user is logged in, and processing can continue.
The above method that I have developed works fine in Firefox, Opera and Safari, but not in IE. Does anyone know why?? For some reason, IE logs you out after you have uploaded the file(s). My question is:
1) Is there a way to restart a session?
2) What information is needed to do this, and where do I find it?
Ford