I hope this isn't against vb regulations, but this is the session/array information for vb :
For vb, you can simply copy the code of the login form to your index page (or template) for vb.
As far as the gallery script goes -- I am not familiar with coppermine, however you can pass the authentication information to a "gateway" script that will pass it along to both coppermine and vb.
For example -- say coppermine requires a third item in the login form (a drop down that has the gallery to be logged into for example). You can add this to your "generic" login form. Set the target of your form to your gateway script. In that gateway script -- pass the user name/password/sessionid to the vb login form -- and the user name/password/gallery information to the coppermine login script. That way, using one form, your user is logged into both applications. You can have this gateway script set a cookie when the user is logged in, and check that cookie in your main site template. If that cookie exists, don't display the login form.