问题标签 [session-management]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
1980 浏览

java - 春季会话并发

我想使用 spring security 来处理会话并发。我想阻止登录相同的帐户。到目前为止,我所做的是通过实现AuthenticationProvider. 我覆盖了authenticate()方法,我认为身份验证过程现在很好。我的下一步是添加会话并发。我在我的spring xml中添加了这个:

我已经尝试登录相同的帐户,但它仍然能够通过。你能告诉我我错过了什么吗?有什么我需要实施或扩展的吗?我的xml配置错了吗?

谢谢。

编辑:按要求记录

0 投票
0 回答
120 浏览

java - Web 服务浏览器和会话管理

如何在 Eclipse 中使用 Web 服务资源管理器测试会话管理?我曾经HttpSession session = ((javax.servlet.http.HttpServletRequest)mc.get(MessageContext.SERVLET_REQUEST)).getSession();在服务器端获取会话并((BindingProvider)proxy).getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY,true);维护来自客户端的会话。

但这在 Web 服务资源管理器中是不可能的。还有其他方法吗?

由于我目前正在开发 Web 服务,因此每天都在更改它,我目前正在通过使用wsimport或使用Eclipse's向导生成客户端代码来测试它。我想在 GUI 中测试它并尝试了 Web 服务资源管理器,但无法管理会话。

对于 Web 服务的简单测试,任何建议都会有所帮助。

编辑:我读了这个,我想要一些与 Web 服务资源管理器相关的东西。

0 投票
2 回答
1642 浏览

properties - 如何在 wso2 ESB 中全局设置属性

我试图弄清楚如何在 wso2 esb 中实现会话管理。所以我编写了一个类调解器,它生成我想要存储的 session_ID。为了存储会话 id,我使用以下代码:

但是在我的 esb 代理中运行它时,它会在 getCurrentMessageContext 部分引发空指针异常。我采用了另一种方法,我将 sessionID 存储在属性中介中并尝试获取它的值,但是当我在 try 的 generateSessionID 操作之后单击 postRequest 操作时-它。所有属性都被重置,我的 sessionID 属性给了我空值。我应该怎么做才能纠正这个问题?有没有替代方法?

0 投票
2 回答
6451 浏览

java - some questions/mystery about browser session and session Id?

As per my understanding same session is shared among different tabs of same browser window. And for different browser window , different session is created. Now some questions on my understanding:-

1)When i hit my web application in two different browser window, i see same jsession id on firefox console. How same session session is shared among two different browser window. As by default session is maintained through cookies with the help of jsessionId which is created by webserver. Other way of maintaining the session thru URLRewriting where we maintain session by passing jsessionId in each url request. I can see using org.tuckey.web.filters.urlrewrite.UrlRewriteFilter in project but this class document does not seem to do any magic much session maintenance. I am not getting how come same session is attached with two different browser window and techinical approach to do it

2)similary when i hit two different application under two different tabs of same browser window probably google and some other website say yahoo, i dont see same jsessionId in firefox console for these two website. Is the website doing some special stuff here to generate new session for each Tab? In fact for some website(probably for google) i do not see jsessionId at all under firefox window. How its possible. My understanding it is generated automatically by webserver and is passed either by cookies or URLReWriting?

It would be helpful if somebody can answer inline to my question as its important to understand each point posted here for session management

UPDATE:- Let me put my questions with different scenarios:-

1)Hit two different URL(say google.com and stackoverflow.com) in two different tab of same browser window.

My Understanding:- Two session will be created as two cookies will be created for two different domain/port

2)Hit two same URL(say stackoverflow.com) in two different tab of same browser window.

My Understanding:- Onesession will be created as same cookies will be reused

3)Hit two same URL(say stackoverflow.com) in two totally different window of browser (firefox).

My Understanding:- how many session will be created in this case?

0 投票
0 回答
808 浏览

java - 来自 java 应用程序的移动应用程序身份验证和会话管理

我正在寻找以下列出的问题的建议

我有一个基于 java 开发的 Web 应用程序和具有以下功能的当前 Web 应用程序

  1. 身份验证(登录/注销)
  2. 会话管理
  3. 带有订阅和配置文件编辑的仪表板
  4. 一些 CRUD 功能。

现在,我正在计划具有相同未来的移动应用程序。由于我当前的应用程序能够提供 RESTFul 服务来执行 CRUD 操作。让我知道在移动应用程序中实现身份验证和会话管理的最佳方法?

提前感谢您的建议。

祝你有美好的一天。

0 投票
1 回答
118 浏览

javascript - 在服务器上的所有会话管理请求中传递参数

我正在制作一个 Web 应用程序,服务器需要跟踪请求来自哪个浏览器选项卡/窗口。

我的做法:

将窗口/选项卡名称 (window.name) 作为参数传递给从浏览器到服务器的所有请求。

问题:

1 . 是否有一种通用的方法来执行此操作,即即时将参数附加到 url,而不是将参数单独附加到表单、锚点和 ajax 调用?

2 . 有更好的方法吗?

0 投票
1 回答
435 浏览

session - Is it possible to expire or delete a specific session in ColdFusion, other than the one for that request?

Important: I do not mean ending the session associated with the current request. I mean, given some identifier, is it possible to clear out that session?

I'd like to implement Single Sign Out. As part of that, it would be convenient if on logout, I could send a POST request to each ColdFusion app using the Single Sign In, telling them to clear out the existing Session for that record.

These are the alternative techniques I've thought of:

  • Storing something in a table that corresponds to the session variable, and deleting it. Each time a page is loaded, it would have to check the table for an active record
  • Creating a Server-scoped struct where the session IDs are keys. After logout, the first ColdFusion app to get the logout request would delete that key from the struct

However, to avoid adding additional layers of complexity, it would be much better if I could just remove that specific session directly. That way I know that it is gone and don't have to worry about running extra code on each request.

0 投票
1 回答
1121 浏览

spring - 如何使用 Spring Security 通知用户另一个会话?

我有一个设计/系统要求来通知用户,在登录之前User-A有另一个活动会话(通过)。您如何使用 Spring Security 完成此任务?User-BUser-A

场景是这样的:

  1. John Doe使用用户名johndoe登录系统
  2. Jane使用johndoe登录系统
  3. 系统应该向两个用户显示一个通知(包括另一个用户的 IP 地址),表明有另一个使用他或她的用户名创建的会话。

例子:

Jane登录后Step-2John Doe在发出新请求(如单击链接)时将收到 ff。通知:

同时,在Jane登录后,还会通知她在登录之前还有另一个活动会话。

我尝试研究自定义会话管理过滤器、自定义并发会话过滤器和自定义并发控制策略,但我无法理解这个主题。我似乎无法确定我应该定制的 w/c 项目。

我还阅读了Spring Security 文档的会话管理一章,但我坚持如何实现上述要求。

0 投票
0 回答
481 浏览

perl - perl cgi 会话信息未在新页面上返回

我正在尝试使用 cgi::session,但还没有运气。index.html 具有获取用户凭据的表单,将它们与 mysql 数据库值匹配,如果正确,则设置会话,否则显示 login.html

此页面正确提供输出,它会生成会话 ID,但是当我单击检查页面链接时,它不会显示会话信息,并且我总是收到“无会话”消息。

这是logout.cgi中的代码

我究竟做错了什么?

我怎么会得到两个不同的结果。
1. IE9和Firefox显示started session id,但是点击check.cgi IE显示不同的session id,而Firefox没有显示。
2. 两个浏览器都返回,session->is_empty为真。当 check.cgi 运行时。

当我从命令行模式运行脚本时,它不会显示任何错误。(返回语法正常)我正在尝试从 cookie 和 param 中检索会话信息,但还没有运气。

注意:不想使用 dancer、catalyst 等框架,以保持简单的目的

0 投票
1 回答
759 浏览

visual-studio-2012 - Visual Studio 会话管理

在处理特定的错误或功能时,我喜欢打开一组特定的文件(除其他外)。

当我在任务之间切换时,我不想丢失所有这些上下文 - 所以我发现我可以从 Visual Studio 解决方案文件夹中复制 .suo 文件。每当我想回到某个上下文时,我只需用备份副本覆盖原始 .suo 文件。

有没有更简单的方法来完成我想要的?任何附加组件或扩展,例如某种会话管理器扩展?

请注意,我指的不是诸如Window Layouts之类的东西,据我所知,它们已经可以通过使用现有的 Import/Export Settings 选项进行保存。