Can't read session variable set outside of Joomla in module

Discussion and education for beginner / novice programmers interested in embarking on the development process to take advantage of the extensible nature of the Joomla! CMS.
Locked
bshack
Joomla! Apprentice
Joomla! Apprentice
Posts: 22
Joined: Fri Jul 13, 2007 1:20 pm
Contact:

Can't read session variable set outside of Joomla in module

Post by bshack » Wed Aug 20, 2008 2:19 am

I wrote a custom module that depends on a session variable set outside of joomla on my server for the same domain name. I am simply trying to read it in my joomla 1.5.6 module.. but It doesn't seem to exist when it is called inside of joomla... any ideas on how I can read it?

Here is basically my module..

<?php
session_start();
if($my_custom_session_array['var_name']) {
header('Location: http://google.com');
}
?>

bshack
Joomla! Apprentice
Joomla! Apprentice
Posts: 22
Joined: Fri Jul 13, 2007 1:20 pm
Contact:

Re: Can't read session variable set outside of Joomla in module

Post by bshack » Wed Aug 20, 2008 1:51 pm

If I put this in the index.php file in the root it works sort of..

<?php
session_start();
$checkfrontpageview=$_GET['view'];
$checkfrontpageoption=$_GET['option'];
if(($myuser and $checkfrontpageview == 'frontpage') or ($myuser and $checkfrontpageoption == '')) {
header('Location: /directory/index.php?page=home');
exit;
}

It seems that joomla will delete all existing non joomla sessions when a joomla pages load.. is there a work around so that it doesn't keep clearing my custom set session variables when I browse the site?


Locked

Return to “Joomla! Coding 101”