Homegrown php portal integration - session_start sequence

kmulder

Joined: 2007-07-18
Posts: 6
Posted: Wed, 2007-07-18 17:18

In reference to the doc at http://codex.gallery2.org/Gallery2:Embedding:Integration which talks about embedding G2 into an emApp.

My php empApp is a homegrown single sign on portal running under freebsd, apache2, php5, mysql.
The structure of my empApp is that the entire app has a single "entry point". The apache server has been configured with an aliasmatch directive to allow a url like http://myserver.sample/webapp to always go to a specific php program. This php program acts as the single entry point to my entire portal. The first thing that my entry point program does is to do a php session_start command. With the session data the entry program determines whether to provide a login screen. If the user has already logged on then the program will use posted data, or query string info to determine the what further processing needs to be done. My entry point program will then php include/require any other code which needs to be called to service the users request.

The example code "sample_embedding_wrapper.zip" is commented "It's important that you don't output any html / anything before you call runGallery".

My empApp entry point program has to do a session_start command to determine if a user has logged on and who that user is. The php session_start command "outputs" html header info for the session cookies as soon as it is called. Is this a problem?

Has anyone done a similar integration?

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Fri, 2007-07-20 12:26

> . The php session_start command "outputs" html header info for the session cookies as soon as it is called. Is this a problem?

i guess you mean HTTP headers, not HTML <head>. correct?

sending HTTP headers before calling g2 is fine. outputting HTML (be it <head> or anything else) is a problem.

--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage

 
kmulder

Joined: 2007-07-18
Posts: 6
Posted: Fri, 2007-07-20 13:10

Yes, i was refering to the http headers which are sent by the "session_start" command.

It would be nice if your integration doc discussed this. Somewhere in the process the "master" emApp needs to retrieve its session info to be able to tell G2 who the user is. so some indication of where you expect that to happen in the process would be nice.

And the comment in "sample_embedding_wrapper.zip" which says to not output any "html / anything" kinda led me to believe that i couldn't even output headers.

thanks for the quick responce.