Logout link not working from embedded PHP app. [SOLVED]
|Posted: Sun, 2010-02-07 14:37|
I have a standalone homepage away from my Gallery application. It’s written in PHP (not Smarty) and contains a number of navigation links, one of which is a LOGOUT link. I want to be able to click on LOGOUT, for Gallery to log me out, then reload the same homepage (i.e. not redirect me to main.php) but take me to a logged OUT state of this page.
I can login to my Gallery app through the embedding API, which works perfectly. The only issue I have is on clicking the LOGOUT link the process fails and I receive the following error.
I’ve searched through all of the support info and realise from thread http://gallery.menalto.com/node/84312 that I can’t put the $authToken in the LOGOUT link due to security reasons. Valiant suggests in this post
“the logout link cannot be hardcoded. if you want to insert a logout link in another page, you can use g2's (PHP / smarty templates) API to generate the logout link. or you can use g2's (PHP) API to logout”.
I can’t use smarty, as I’m in a full PHP page. I therefore want a PHP-only way to log out of an embedded page, log me out then reload the same page in a logged out state. I assume I should be able to use g2’s PHP API, as suggested by Valiant. I therefore searched in the GalleryEmbedApi docs and found a “GalleryEmbed::logout();” command, but I can’t get this to work.
I’m no doubt missing something small, but having searched hard to find the answer, I’m stuck. Does anyone have any advice?