You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Jordan Baker <su...@rogers.com> on 2002/10/09 23:02:48 UTC

redirect question

Hi.. Im trying to get redirection working with embperl 2.0b8
 
Tried doing:


  $http_headers_out{`Location`} = 'http://$ENV{HTTP_HOST}/ta/login.epl';
  exit 301;
 
But I don't get a redirect in the browser.
 
I did something that worked using the Apache module and doing like so:
 
   use Apache;
   use Apache::Constants qw(REDIRECT);
   $req = Apache->request;
   $req->header_out("Location" =>
"http://$ENV{HTTP_HOST}/ta/login.epl?return_url=$ENV{SCRIPT_NAME}");
   $req->status(REDIRECT);
   exit 301;
 
However. since I am using a Session feature. and not using Cookies.. I
would like to include the SESSION ID in the URL I am generating but I
haven't been able to see that this is possible.
 
A quick perusal of the docs & Embperl *.pm files shows no method to
retrieve the session id..
 
Any suggestions? Please cc me when you reply to the list as well. 
 
Thanks,
______________________
Jordan Baker
jbb@contradix.com 
 

Re: redirect question

Posted by Kee Hinckley <na...@somewhere.com>.
At 5:02 PM -0400 10/9/02, Jordan Baker wrote:
>Hi.. Im trying to get redirection working with embperl 2.0b8
>
>
>
>Tried doing:
>
>   $http_headers_out{`Location`} = 'http://$ENV{HTTP_HOST}/ta/login.epl';

I think you need double quotes there instead of single, although you 
sent this in such a small font that I can't tell for sure.

Switching to plain text....

Yes.  That's the problem.

Please reserve HTML email for things that need it.  Like.... 
ummmm....  hmm....  Well anyway, not for technical support.


P.S. I assume you didn't really put back quotes around `Location`, 
and that's just Microsoft Outlook screwing with the content of your 
email.
-- 

Kee Hinckley - Somewhere.Com, LLC
http://consulting.somewhere.com/

I'm not sure which upsets me more: that people are so unwilling to accept
responsibility for their own actions, or that they are so eager to regulate
everyone else's.

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: redirect question

Posted by Kee Hinckley <na...@somewhere.com>.
At 6:44 AM +0200 10/10/02, Gerald Richter wrote:
>As Kee already wrote:
>
>>   $http_headers_out{`Location`} = 'http://$ENV{HTTP_HOST}/ta/login.epl';
>>   exit 301;
>
>   $http_headers_out{'Location'} = "http://$ENV{HTTP_HOST}/ta/login.epl";
>   exit 301;

Also, if you are trying to be fully portable, you should check the 
PORT too, and see whether you are on a secure connection, since those 
will impact the http and whether you need to include a port number.
-- 

Kee Hinckley - Somewhere.Com, LLC
http://consulting.somewhere.com/

I'm not sure which upsets me more: that people are so unwilling to accept
responsibility for their own actions, or that they are so eager to regulate
everyone else's.

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: redirect question

Posted by Gerald Richter <ri...@ecos.de>.
>I also found another way to get the Session ID... using
>$udat{_session_id}
>
>Though I assume that '$request -> config -> session_id' would be the
>preferred method...?

Oops, must be $request -> session_id. It's a bug in the docs :-(

Both should work equaly well

Gerald


-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------






---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org



-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------





---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


RE: redirect question

Posted by Jordan Baker <jb...@contradix.com>.
Thanks Kee and Gerald...

I also found another way to get the Session ID... using
$udat{_session_id}

Though I assume that '$request -> config -> session_id' would be the
preferred method...?

Ps. sorry about the HTML mail...
______________________
Jordan Baker
jbb@contradix.comĀ 


-----Original Message-----
From: Gerald Richter [mailto:richter@ecos.de] 
Sent: October 10, 2002 12:45 AM
To: jbb@contradix.com; embperl@perl.apache.org
Subject: Re: redirect question

As Kee already wrote:

>  $http_headers_out{`Location`} =
'http://$ENV{HTTP_HOST}/ta/login.epl';
>  exit 301;

  $http_headers_out{'Location'} = "http://$ENV{HTTP_HOST}/ta/login.epl";
  exit 301;


> A quick perusal of the docs & Embperl *.pm files shows no method to
retrieve the session id..

See http://perl.apache.org/embperl/pod/doc/Config.-page-4-.htm#sect_105

Not much explaination yet, but at least it is there...

Gerald



-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------






---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: redirect question

Posted by Gerald Richter <ri...@ecos.de>.
As Kee already wrote:

>  $http_headers_out{`Location`} = 'http://$ENV{HTTP_HOST}/ta/login.epl';
>  exit 301;

  $http_headers_out{'Location'} = "http://$ENV{HTTP_HOST}/ta/login.epl";
  exit 301;


> A quick perusal of the docs & Embperl *.pm files shows no method to
retrieve the session id..

See http://perl.apache.org/embperl/pod/doc/Config.-page-4-.htm#sect_105

Not much explaination yet, but at least it is there...

Gerald



-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------




---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org