UNIGUI:How to redirect and close session?

來源:互聯網
上載者:User

標籤:

Hello,

i would have 2 unigui app.

 

the first app is a simple authentification app and second will be the main app.

 

I‘d like to have the following scenario.

user "paul" arrive on the auth app

paul set his login and password.

the auth app redirect paul  to an other server with some parameters( sended with post method) and session on auth app will close.

the main app read "post parameters" and begin a user session. on close or on timeout in the main app the user will be redirect to the auth app.

 

To sum up,

how can i do a redirect with parameters (post method) and close current session ?

 

  • 0
  • Report
#2 Delphi Developer

Advanced Member

  • Moderators
  • 726 posts

Posted 04 September 2015 - 05:43 AM

delagoutte, on 03 Sept 2015 - 11:47 PM, said:

the auth app redirect paul  to an other server with some parameters( sended with post method) and session on auth app will close.

the main app read "post parameters" and begin a user session. on close or on timeout in the main app the user will be redirect to the auth app.

 

To sum up,

how can i do a redirect with parameters (post method) and close current session ?

 

Hi,
I think there are several ways to redirect to another server with some parameters from the first app, for example, one of these:

 

first app:

procedure TMainForm.UniButton1Click(Sender: TObject);begin  UniSession.AddJS(    ‘var f = document.createElement("form"); ‘+    ‘f.action="http://localhost:8079"; ‘+ // the second app url    ‘f.method="POST"; ‘+    ‘var i=document.createElement("input"); ‘+ // username    ‘i.type="hidden"; ‘+    ‘i.name="username"; ‘+    ‘i.value="login"; ‘+    ‘f.appendChild(i); ‘+    ‘var i2=document.createElement("input"); ‘+ // password    ‘i2.type="hidden"; ‘+    ‘i2.name="password"; ‘+    ‘i2.value="pwd"; ‘+    ‘f.appendChild(i2); ‘+    ‘document.body.appendChild(f); ‘+    ‘f.submit(); ‘  );end;

..and session on auth app will close...

 

I think here too, there are several ways maybe you can use the timer in the first app after the call redirection ??:

procedure TMainForm.UniTimer1Timer(Sender: TObject);begin  UniSession.Terminate();end;

second app:

 

firstly, need to analyze the demo project:

C:\Program Files (x86)\FMSoft\Framework\uniGUI\Demos\Desktop\URLParameters...

..on close or on timeout in the main app the user will be redirect to the auth app...

 

UniServerModule.ServerMessages.TerminateTemplate..:

 

http://forums.unigui...ose/#entry28523

<html><script>function redirect() {    location.href = "http://localhost:8077"; // first app url} window.onpaint = redirect();</script><body bgcolor="#dfe8f6"></body></html>

Try...

 

Best regards.

  • 0

UNIGUI:How to redirect and close session?

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.