简体   繁体   English

如何在Oracle JET应用程序中管理会话

[英]How to manage session in Oracle JET application

How can I manage the session in Oracle JET application. 如何在Oracle JET应用程序中管理会话。

I've been working on small pilot application where I need to check if the user is logged in on every request. 我一直在研究小型试用应用程序,我需要检查用户是否每次请求都登录。

I didn't find any resource on the same as the framework is recently published by Oracle. 我没有找到与Oracle最近发布的框架相同的任何资源。

JET uses web sessions if you configure it as a web application. 如果将其配置为Web应用程序,JET将使用Web会话。 So authentication would be managed by the Web server. 因此,身份验证将由Web服务器管理。

Frank 坦率

Because of the client nature of JS source, there's no session on the JET side of your application, Session is a (HTTP) browser feature. 由于JS源的客户端特性,应用程序的JET端没有会话,Session是(HTTP)浏览器功能。 You might handle session exactly the way you did with a pure JavaScript, JQuery, Angular or everything else application. 您可以完全按照纯JavaScript,JQuery,Angular或其他所有应用程序的方式处理会话。

There may be two ways to do it 可能有两种方法可以做到这一点

  1. Use web server to manage the sessions. 使用Web服务器管理会话。

  2. You can store session values (some data after login REST API call) in local storage or sessions storage based on your need. 您可以根据需要在本地存储或会话存储中存储会话值(登录REST API调用后的一些数据)。 For managing session you can check in your app controller and redirect based on that. 对于管理会话,您可以检查您的应用程序控制器并根据它重定向。

Hope this help, please let me know if you faced any problem. 希望这有帮助,如果您遇到任何问题,请告诉我。 I have recently implemented session in Oracle JET based on the above points. 我最近基于以上几点在Oracle JET中实现了会话。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM