Custom Sessions with Joomla

2020-02-26 02:08发布

I've trying to build Joomla into my existing website so I can use it for premium content.

I've already got a custom-built authentication system that sets my own session variables.

For some reason, Joomla (which is located in a different directory) doesn't want to recognize these session variables, even when adding the session_start(); line at the top of all Joomla pages.

Any idea how I can get Joomla to recognize my custom session variables so I can limit the content located in Joomla to only premium users?

Thank you.

7条回答
太酷不给撩
2楼-- · 2020-02-26 03:13

i keep seeing people saying that phpsessions won't work in joomla and i wasn't ready to learn the joomla framework for their session management, i had no time for it, so i've done some tests and i found that if you just start the php session in the main page of your template and not on your website index page it will work fine. just put this line of code on the top page of your template page:

<?php
// Starting the phpsession
session_start();    
?>
查看更多
登录 后发表回答