I have group of websites with a single user database. I assign each user a single home site based on their original registration. If a user logs in from his/her home site, the normal login process takes place. However, if a user attempts to login from a site other than his/her home site, I redirect the request to the home site. Following is the sequence of calls in the event user logs in from non-home site.

http://non-homesite/login.cgi - The perl code in non-homesite server redirect to http://homesite.com/login.cgi?UserId=xxx&Password=yyy

The home site upon receiving the request, processes the login and this time the perl code in the home site redirects to http://homesite.com/memberoptions.cgi

This works OK. But the problem is that the URL (revealing the password as one of the params) for the first redirection shows in the browser location bar briefly (before it is replaced by the second redirection URL).

I am using CGI::Session to set the sessions. I would like to be able to do 1 of the following 2 things.

1. Not have the params show (in the browser location bar) during the first redirection. It appears that GET is the only method I can use during redirection (which I do using CGI.pm methods)

2. Set the session for the home site, from a non-home site. This again looks like not a possibility in the normal way with CGI::Session as cookies for the domain would need to be set.

Is there a third way? My goal is to get the user automatically logged to the home site regardless of the site he/she is logging into.

My knowledge of perl and other web technologies is very limited. I would appreciate any advice.


In reply to A perl session question by rajivp

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.