2016-10-10 19:07
浏览 69

如何使用CodeIgniter 3.x将会话数据传递给CKFinder?

I know there is already an existing question identical to this (How do I pass session to ckfinder in codeigniter 3?) but it does not help at all. There's only 1 answer and it does not work for me and very little explanation is provided.

I have a CI site in which a user can log in and edit some stuff using CKEditor. I've installed CKFinder as well, but I'm unable to pass any session data to the CKFinder config file in order to authenticate the login for security. The global $_SESSION variable just returns Array() 1 and doesn't contain any of the session data (and yes, I'm using session_start();).

Using the other post's answer as a foundation, I tried retrieving data from $_COOKIE but there didn't seem to be anything particularly useful. There is no ci_session in the cookie data. The closest thing is PHPSESSID but I couldn't get anything useful from that.

Any help would be appreciated it. I've spent too long on this project already. Thanks!

图片转代码服务由CSDN问答提供 功能建议

我知道已存在一个与此相同的问题(如何在codeigniter 3中将会话传递给ckfinder?)但它根本没有帮助。 只有一个答案,它对我不起作用,并提供了很少的解释。

我有一个CI网站,用户可以使用CKEditor登录和编辑一些内容。 我也安装了CKFinder,但我无法将任何会话数据传递给CKFinder配置文件,以便验证登录的安全性。 全局 $ _ SESSION 变量只返回 Array()1 ,并且不包含任何会话数据(是的,我正在使用 session_start(); )。

使用其他帖子的答案作为基础,我尝试从 $ _ COOKIE 检索数据,但似乎没有什么特别的 有用。 cookie数据中没有 ci_session 。 最接近的是 PHPSESSID ,但我无法从中获得任何有用的东西。

任何帮助都将不胜感激。 我已经在这个项目上花了太长时间。 谢谢!

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dongmu3457 2016-10-11 05:59

    You should not be altering a config file by writing to it for each user. Since this is a commercial application I cannot view the docs for it, but this might help.

    1. Set the link on the user page to CKfinder to only show if the user is logged in.
    2. Set the controller CKfinder links to within CI to detect if the user is logged in or not and allowed (ie authenticated and authorized), otherwise reject the request.
    3. Alternatively create a CI library for CKfinder that runs it from within CI.

    Knowing CKeditor quite well, I am sure CKfinder will be documented quite well to integrate with frameworks and existing systems quite easily. CKeditor is a beautiful script (albeit with limitations) so I would presume the same quality applies to CKfinder.

    And yes, CI session data is not available outside CI. Third party apps like this can be integrated with CI using standard includes directly or with a library etc within the CI framework. In fact one of the great things about CI is the ability to write small libraries that can easily include almost any third party app with relative ease of implementation.

    This link will help: Codeigniter 3 - Access Session from Outside Codeigniter Installation

    Without further code samples or a more exact example of the problem, I am not really sure how I can help more than that. I hope it might of been of some help but it probably was not. Sorry.

    打赏 评论

相关推荐 更多相似问题