cookie issues

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jmoncrieff
Forum Newbie
Posts: 3
Joined: Fri Sep 11, 2009 3:03 pm

cookie issues

Post by jmoncrieff »

hello,
I have wrote a application over the last couple of months and I am currently in the stage of releasing it to the client. but yesterday I upload the new site (Jommla with jomfish and my new application) to there server. there sames to be a problem getting the language cookie from jommla to my appilcation witch is two directory below Jommla ie
/cms and my appilcation is /cms/servicedesk/fontend/

I used the This method to get the lang variable.

Code: Select all

 
$langchk=$_COOKIE['jfcookie'];
$lang=$langchk['lang'];
 


is there any in the php.ini that could be causing and can be corrected with tweaking the .htaccess. I just do not want have rewrite my code if I do not have to. I as I am also in school also so my time is limited


Thanks In advance
jmoncrieff
Forum Newbie
Posts: 3
Joined: Fri Sep 11, 2009 3:03 pm

Re: cookie issues

Post by jmoncrieff »

I ended up Creating a new function and defining the cookie path to ie: /newsite/cms

Code: Select all

 
function get_lang(){
define('cookie_path',$cmspath);
if(isset($_COOKIE['jfcookie'])){    
$langchk=$_COOKIE['jfcookie'];
$lang=$langchk['lang'];
}
else
{
    $lang='en';
}
return $lang;
}
This works perfectly now.
Jeff
Post Reply