在asp.net和java之间共享会话变量

时间:2022-11-06 01:57:20

My login page is in asp.net. I want to share session between various pages which are in java as well as asp.net. I even want to clear the session when user logouts from any of these pages.

我的登录页面是在asp.net中。我想在java和asp.net之间的各个页面之间共享会话。我甚至想在用户从这些页面中注销时清除会话。

2 个解决方案

#1


0  

You can handle this, of many ways. You can send one token(GUID) generated in asp.net aplication to Java pages, after do that this you can verify token when the session exist in asp.net. When the user click for logout in java page, you redirect to a page in asp.net and execute the comand for erase this session. Hope Help you.

您可以通过多种方式处理此问题。您可以将在asp.net aplication中生成的一个令牌(GUID)发送到Java页面,在此之后,您可以在asp.net中存在会话时验证令牌。当用户在java页面中单击注销时,您将重定向到asp.net中的页面并执行命令以擦除此会话。希望能帮助你。

#2


0  

A good way to transfer data is by turning it into a JSON string and then posting it to the new page, which will in turn populate variables and/or objects with values in the JSON string.

传输数据的一种好方法是将其转换为JSON字符串,然后将其发布到新页面,新页面将依次使用JSON字符串中的值填充变量和/或对象。

Apologies for the quickness answer. I intend to revisit this answer in the future and add an example to help user3225045's specific issue.

为快速回答道歉。我打算将来重新回答这个问题,并添加一个示例来帮助user3225045的具体问题。

This should at least send them on the correct road though.

这应该至少让他们走上正确的道路。

In C# I use 'Newtonsoft JSON' and I use 'minimal-json' in Java.

在C#中,我使用'Newtonsoft JSON',我在Java中使用'minimal-json'。

(Alternatives are probably available)

(可能有替代品)

Note: This answer will work for sending messages between pages managed by all manner of different languages.

注意:此答案适用于在由各种不同语言管理的页面之间发送消息。

#1


0  

You can handle this, of many ways. You can send one token(GUID) generated in asp.net aplication to Java pages, after do that this you can verify token when the session exist in asp.net. When the user click for logout in java page, you redirect to a page in asp.net and execute the comand for erase this session. Hope Help you.

您可以通过多种方式处理此问题。您可以将在asp.net aplication中生成的一个令牌(GUID)发送到Java页面,在此之后,您可以在asp.net中存在会话时验证令牌。当用户在java页面中单击注销时,您将重定向到asp.net中的页面并执行命令以擦除此会话。希望能帮助你。

#2


0  

A good way to transfer data is by turning it into a JSON string and then posting it to the new page, which will in turn populate variables and/or objects with values in the JSON string.

传输数据的一种好方法是将其转换为JSON字符串,然后将其发布到新页面,新页面将依次使用JSON字符串中的值填充变量和/或对象。

Apologies for the quickness answer. I intend to revisit this answer in the future and add an example to help user3225045's specific issue.

为快速回答道歉。我打算将来重新回答这个问题,并添加一个示例来帮助user3225045的具体问题。

This should at least send them on the correct road though.

这应该至少让他们走上正确的道路。

In C# I use 'Newtonsoft JSON' and I use 'minimal-json' in Java.

在C#中,我使用'Newtonsoft JSON',我在Java中使用'minimal-json'。

(Alternatives are probably available)

(可能有替代品)

Note: This answer will work for sending messages between pages managed by all manner of different languages.

注意:此答案适用于在由各种不同语言管理的页面之间发送消息。