Hi guys I've download the latest version of joomla and I'm trying to analyze it's session but I had a problem with the session name and getsession() .
Because all the sessions name is (4109fdb14b2662cce79b856bc4d72ed3)
So my question is where did this value come from?
and one more thing ... where is getsession defined?
use
$session_name = JFactory::getSession()->getName();
Actually Joomla relies on PHP to handle the session id / session.
See also session_id().
As pointed out in comments, have a look the the JSession class.
Related
I'm stuck at this since last 4 hours. I am using Joomla 3.3.6 CMS and JMapMyLdap extension. I'm able to login with my active directory username and password. Extension is only mapping username, email, Full name.
I've few additional attributes like title, manager, department etc. I can see these values in "Debug" functionality of extension but I am not able to find way to retrieve it. Please see attachment for more information.
Did anyone know if JMapMyLdap provides special object that retrieves all these attributes. If yes, then please provide the way to get this object. Please note that, I'm using PHP Module to inject PHP code in article.
I managed to do it with following code:
$user = & JFactory::getUser();
$ldap = SHLdap::getInstance();
$ldap->connect();
$dn = $ldap->getUserDn($user->username);
$read = $ldap->read($dn);
I am creating a application using CANJS. To display the user Information basing on the cookie I am not not knowing how to create and delete a cookie using CANJS.
can some one please help me
Go to http://javascriptmvc.com/docs.html and type cookie in the search box.
$.cookie('name','value');
var value = $.cookie('name');
Or you could use http://jquerypp.com/
may be I'm late but you can try jquery++ cookies
I found a test that fails when run from a browser if you are logged in. I need to make sure the session is cleared out before running this test. Is there an easy way to clear the CakePHP session from within a test?
I tried calling Session::Destroy(); but the test cannot seem to get visibility of Session.
Maybe I am trying to import Session incorrectly?
I am using: App::import('Core', 'Session');
You should mock the Session component. Mark Story himself wrote an article showing how to test controllers.
I believe gustavotkg is correct. We should be using mock objects. Unfortunately, it will not be completely straight forward to do this the way the code was set up. I will have to go back and rework some things. For a temporary fix this is what I did:
$appController = ClassRegistry::init('AppController');
$appController->constructClasses();
$appController->Session->destroy();
if(App::import('Core','Session')) {
$session = new CakeSession();
$session->start();
}
hope this can help you..
I'm using Symfony 1.4 and Doctrine 1.2. I need to get the session ID inside an action.
I'm using doctrine session storage and that works fine. I'm also using sfDoctrineGuardPlugin and am able to get and set session variables in the user according to recommended practice, using code like this:
$this->getUser()->setAttribute('variable_name', $value);
$value = $this->getUser()->getAttribute('variable_name');
But how do I get the session id of the current user?
It seems like you can't access the sfStorage from the user object. The sfSessionStorage stores the user data in the session...
So the only way I currently see is calling the 'native' session_id().
If you want to it perfectly you should extends the sfSessionStorage adding a method to retrieve the session id. Then assign this storage to the user, and you would be able to call $this->getUser()->getStorage()->getSessionId();.
I have seen lots of posts here and elsewhere stating that one can access session variables from app_code. I want to access an already created session.
this code errors out because of a null exception.
string myFile = HttpContext.Current.Session["UploadedFile"];
this creates a null session variable.
System.Web.SessionState.HttpSessionState Session = HttpContext.Current.Session;
It looks like I can create a new session variable but not access an already created one. Anyone have any idea what might be giving me problems?
I was having ths same problem, but I was able to fix it because I controlled where in the event lifecycle I was attempting to leverage HttpContect.Current.Session... it makes a difference because Session isn't available, for example, on construction.
Maybe that will help you.