English 中文(简体)
How can we maintain session variables between our CMS and a standalone script on the same server?
原标题:

We have developed a stand-alone script on the same server as our Joomla 1.5 installation. We want to see if the user is logged into to Joomla before giving them access to the script. To do that, we want to cross reference the session_id from Joomla and then query the Joomla database to verify that the user is logged in.

At this point our standalone script looks like this, just to test whether we can access the session variables.

<?
session_start();
print_r($_SESSION);
?>

However, the session variable is empty and prints out an empty array. Does anyone know why we are unable to pass the session variables to the standalone script? Doing a print_r($_SESSION) from within the Joomla code works just fine.

最佳回答

SEE "Joomla login session" tutorial:

Especially this part:

"Once the frame work is initialised you can start using Joomla session"

SEE ALSO Custom Sessions with Joomla

问题回答

Joomla is probably using a custom session handler.

See: http://www.php.net/manual/en/function.session-set-save-handler.php





相关问题
why the session in iis automatically log out?

I used iis6, and when i called a function Directory.delete(), the all the session relate this website will be logged out. and i debugged the website, i found no exception. any one have ideas on this ? ...

Check session from a view in CodeIgniter

What is the best way to check session from a view in CodeIgniter, it shows no way in their user guide, otherwise I will have to make two views on everything, which is kinda weird...still a newbie to ...

Can I get the size of a Session object in bytes in c#?

Is it possible to get the size(in bytes) of a Session object after storing something such as a datatable inside it? I want to get the size of a particular Session object, such as Session["table1"], ...

提供严格分类的出席会议物体

提供严格分类的与会机会的最佳方式是什么? 我正计划转而选择矩阵,这正在促使汇编者抱怨我的幻觉方案拟订方法......

PHP Session is not destroying after user logout

I m trying to create an authentication mechanism for my PHP Application and I m having difficulty destroying the session. I ve tried unsetting the authentication token which was previously set within ...

热门标签