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

#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?的更多相关文章

  1. C#中的Session

    一: 网站开发中,为了保存用户信息我们就会用到session. Session具有以下特点:(1)Session中的数据保存在服务器端:(2)Session中可以保存任意类型的数据:(2)Sessio ...

  2. django的cookie和session以及内置信号、缓存

    cookie和session cookie和session的作用: cookie和session都记录了客户端的某种状态,用来跟踪用户访问网站的整个回话.两者最大的区别是cookie的信息是存放在浏览 ...

  3. Session、Cookie--2017年1月3日

    Session Session 对象用于存储用户的信息.存储于 session 对象中的变量持有单一用户的信息,并且对于一个应用程序中的所有页面都是可用的.    Session 对象 当您操作某个应 ...

  4. Django实现表单验证、CSRF、cookie和session、缓存、数据库多表操作(双下划綫)

    通常验证用户输入是否合法的话,是前端js和后端共同验证的,这是因为前端js是可以被禁用的,假如被禁用了,那就没法用js实现验证合法与否了,也就是即使用户输入的不合法,但是也没提示,用户也不知道怎么输入 ...

  5. [转]菜鸟程序员之Asp.net MVC Session过期异常的处理

    本文转自:http://www.cnblogs.com/JustRun1983/p/3377652.html 小赵是刚毕业的计算机专业方面的大学生,4年的大学时间里面,他读过了很多编程方面的数据,也动 ...

  6. 菜鸟程序员之Asp.net MVC Session过期异常的处理

    小赵是刚毕业的计算机专业方面的大学生,4年的大学时间里面,他读过了很多编程方面的数据,也动手也了很多代码.现在毕业了,他如愿的加入了T公司,开始了自己的程序员生涯.他信心满满,相信自己4年的学习到的东 ...

  7. Day19 Django之Form表单验证、CSRF、Cookie、Session和Model操作

    一.Form表单验证 用于做用户提交数据的验证1.自定义规则 a.自定义规则(类,字段名==html中的name值)b.数据提交-规则进行匹配代码如下: """day19 ...

  8. ASP.NET Cookie和Session

    Cookie和Session C#在服务器,JS在客户端 客户端验证不能代替服务端验证 Http HTTP属于应用层,HTTP 协议一共有五大特点:1.支持客户/服务器模式;2.简单快速;3.灵活;4 ...

  9. Django学习笔记(5)——cookie和session

    一,前言 1.1,什么是会话跟踪技术 在JavaWeb中,客户向某一服务器发出第一个请求开始,会话就开始了,直到客户关闭了浏览器会话结束.在一个会话的多个请求中共享数据,这就是会话跟踪技术. 例如在一 ...

随机推荐

  1. Linux中的一个命令行计算器bc简介

    假如你在一个图形桌面环境中需要一个计算器时,你可能只需要一路进行点击便可以找到一个计算器.例如,Fedora 工作站中就已经包含了一个名为 Calculator 的工具.它有着几种不同的操作模式,例如 ...

  2. spring的xml配置文件出现故障

    今天在断网的情况下,spring的applicationContext.xml文件开头部分出现红叉 <span style="font-size:18px;">< ...

  3. nginx 内置变量大全

    HTTP核心模块支持一些内置变量,变量名与apache里的对应.比如 $http_user_agent,$http_cookie等表示HTTP请求信息的变量.更多变量:$args, 请求中的参数; $ ...

  4. 第八章 委托,lamdbda 表达式和事件

    第八章 委托,lamdbda 表达式和事件 委托是寻址方式的.net版本. 委托是类型安全的类,它定义了返回类型和参数的类型.委托类不仅包含方法的应用,也可以包含对多个方法的引用. 在 C++中,函数 ...

  5. 【整理】Python中实际上已经得到了正确的Unicode或某种编码的字符,但是看起来或打印出来却是乱码

    转自:http://www.crifan.com/python_already_got_correct_encoding_string_but_seems_print_messy_code/ [背景] ...

  6. Android Studio 使用笔记:查看类结构和继承关系

    选中类 ,按下F4,可以打开类的源代码 在 Eclipse 中我们可以使用 Ctrl + O 组合热键查看类的结构,Android Studio 中也可以做到. View -> Tool Win ...

  7. MIC中的数据传输

    先看一段代码,如下 #include<stdlib.h> #include<stdio.h> #define LEN 5 int main(int argc,char** ar ...

  8. 探究css中各种情况下的元素的垂直和水平居中的问题(面试题)

    今天各种纠结,真的是不想写东西(ps 我比较懒)但是老是有人问这个问题,于是我就本着分享精神还是整理一下,好了废话不多说 开始上代码 问题:外边是一个容器,容器中还有一个容器,那么请问怎么让里边的容器 ...

  9. scp命令需要指定端口时要紧跟在scp后

      问题来源:我本地是Ubuntu操作系统,有时需要更新一些文件到服务器.但是,为了安全起见我们都是将服务器的sshd端口修改的,通常不使用默认的22号端口. 如果我们使用scp命令时:scp upl ...

  10. 信息搜集之google语法

    总结的比较全,无耻的转了.D: http://blog.csdn.net/chaosa/article/details/1828301 说起Google,可谓无人不知无人不晓.作为世界第一的搜索引擎, ...