|Posted: Fri, 2007-11-30 01:40|
In my application more often than not a user will enter parts of the site where I have gallery2 images embedded.
I use the following code:
// URI to Gallery2
// Get the current Joomla User
$error = GalleryEmbed::init(array(
// todo-> some way better error trapping
// Start a Gallery 2 session
Although the documentation states that $session->start() will take care of creating the cookie, it does not seem to.
I have discovered through trial and error specifically calling GalleryEmbed::login($embedUserId) prior to session start will sometimes create the cookie.
If a user enters the actual gallery2 and clicks a link within the main gallery the cookie is created.
My problem is that because of the way my application works more than likely the user will not enter the gallery before clicking on an image some other place in site.
I have no problem if I set all my images permissions to Everyone or Registered Users "core can view all".
This is not what I want I have close to 20 groups in Gallery2 and the embedded images must conform to the permissions set in Gallery2. All works fine in Gallery2 itself it is just in the embedded images.
After much experimentation I have determined the problem to be what I stated at the beginning the cookie is not being created, and since I do not append the gallerySID to my /2.5/gallery2/main.php?g2_view=core.DownloadItem&g2_itemId=22 I need the cookie to be in place.
Any ideas or help is greatly appreciated.