0

Interesting question which I hope there is a workaround for --

I am using Joomla 3.0, for which I have installed the Jumi module. When using session variables, I can use them perfectly through my simple login / createaccount scripts but when I try access the session variable from a Jumi script it doesn't work, any suggestions?

i.e. all of the php files in the directory /Joomla can access the session variable. But, the php files in /Joomla/components/com_jumi/files/ cannot access the session variable.

At the top of my "createaccount.php" page I have the following code:

<?php
   if(!isset($_SESSION)){
   // this starts the session 
   session_start();
   }
?> 

When entering the form data into the database, after validation, I have the following line of code to assign the username to the session variable;

// this sets variables in the session 
    $_SESSION['name']= $_POST["user"];

Then I want to be able to access the username datavalue from the homepage, called general.php so i use at the top of the page;

<?php 
 // this starts the session 
 if(!isset($_SESSION))
 {
 session_start(); 
 }
 echo $_SESSION['name'];
?>

I get an undefined index error as the Jumi php files don't seem to recognise the session?

user3266484
  • 125
  • 1
  • 2
  • 12
  • Please share some code – Lodder Mar 20 '14 at 13:15
  • Use the Joomla session api rather than what you are doing. http://www.ostraining.com/blog/how-tos/development/how-to-use-sessions-in-joomla/ is a good summary. – Elin Mar 20 '14 at 15:34
  • Thank you soooo much! That worked. I have been stuck on that same thing since yesterday and my head was done in from in. Thanks again!! :) – user3266484 Mar 20 '14 at 19:42

0 Answers0