Difference between #1 and #2 of
Syncing sessions between Yii and KCFinder

Revision #2 has been created by Boaz on Mar 14, 2014, 9:01:29 PM with the memo:

adding comment about need no work if session handling is the same for both the yii webapp and kcfinder
« previous (#1)

Changes

Title unchanged

Syncing sessions between Yii and KCFinder

Category unchanged

How-tos

Yii version unchanged

Tags changed

File upload

Content changed

>Info: As KCFinder's documentation [mentions](http://kcfinder.sunhater.com/integrate#session ""), if your application (Yii in our case) session handling is using the PHP environment configuration - meaning no change in session handling at all, then no change is needed also on KCFinder side to be able to use this session and thus have this simple interface between your Yii webapp and KCFinder. If that's your case then you probably need not read the rest of this article but rather just make sure that before a user attempts to upload or browse your server a session variable is already set for him (or her) with his specific [configuration](http://kcfinder.sunhater.com/install#config "") already waiting for KCFinder there. What can this session interface be useful for? For example, for having per-user upload directory. You could have *uploadURL* variable established in the session variable to contain the user's id. When an upload or browse use case will occur, the client side will trigger the KCFinder completely decoupled from the Yii application. Yet, since you've already synced your user-specific-configuration with KCFinder via the session, KCFinder will pick it up and use it. 
 
 
I have been trying to find information on how to sync the sessions between Yii and KCFinder so that the two applications can "communicate" with each other. I managed to find some bits and pieces on the correct approach to use, but not a definite guide or concrete code.

So... if you are using Yii with CDbHttpSession and also want KCFinder to share the same session as Yii, you must create your own SESSION SAVE HANDLER as described [here](http://kcfinder.sunhater.com/docs/integrate#session "Session configuration").
[...]
That's It!

Feel free to comment on the approach used and suggest any other tips.

 
1 0
6 followers
Viewed: 16 477 times
Version: 1.1
Category: How-tos
Written by: Thanasis Fotis
Last updated by: Boaz
Created on: Nov 20, 2012
Last updated: 10 years ago
Update Article

Revisions

View all history