Reading Curent user info

I use Joomla CMS and need to read Joomla session variable with curent Username --> into the SC App.
Any ideas of the best approach ?

Arthur

I guess you need the configuration.php and change the $session_handler (see https://www.ostraining.com/blog/joomla/guided-tour-your-joomla-configurationphp-file)
I guess you need to check jos_session for it. Just do a search on that table.

I know is http://docs.joomla.org/JFactory/getUser but really don’t know how from SC (and interested to). I guess the trick is in some includes.

rr - thanks for great tip !

unfortunately they do not explain the difference between dB and NONE handlers. I assume if it is set to dB then your next line is true and the jos_session holds that information.
I tested this on standard default Joomla v3.2 installation and my working site.
IT seems like testing against session table should be enough, although one more question arise:

Say I want to test upon opening any SC app to see if the particular logged in user should be able to access the App or not. This should be easy, however I would like to have this implemented as function (or method) globally so I do not have to replicate the code for that in every App. What would be the best approach to do this ?
I would like to see something simple like:

IF useraccess(ID)=TRUE
StartApp
ELSE
ShowError
END

Sadly enough my joomla experience is rather ancient. I guess you could add it in the library, I would choose the public library for that. You can use functions from the public library over the whole application.