Android的会话迷路了IBM WebSphere服务器 [英] Android Session getting lost in IBM Websphere Server

查看:319
本文介绍了Android的会话迷路了IBM WebSphere服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我打的登录页面从Android设备中,会话必须创建和维护,直到用户点击退出按钮。但似乎有一个奇怪的问题与IBM的Websphere服务器..我可以登录成功,但是当我尝试请求会话从服务器获取失去了一些其他的数据,这是不是与服务器iOS设备的工作正常在Apache Tomcat运行..也如此!

Whenever i hit the login page from an android device , a session has to be created and maintained until the user hits log out button.. But there seem to be a weird problem with IBM Websphere Servers .. i am able to login successfully but when i try to request some other data the session is getting lost from the server , this is not the case with server running on Apache TomCat .. also in iOS Devices its working fine !

例如:
 >此用户创建一个会话 - 1.用户登录
 2. Android应用击中服务器continously以1秒的间隔
 3.用户注销 - >用户成功loggged了

Example : 1. user logs in -> creates a session for this user 2. Android App hits the server continously with 1 sec interval 3. user logs out -> user is loggged out successfully

这个流程在Apache Tomcat上的情况下,去正确的,但在WebSphere的情况下,在步骤2 ..会话被迷路,因为它的用户甚至不能注销

this flow is going proper in case of Apache TomCat , but in case of Websphere at step 2 .. the session is getting lost , because of which the user cant even log out

可能是什么问题?是有什么我可以在服务器端会丢失?抑或是WebSphere有兼容性问题?

what could be the issue ? is there something i could be missing on server side ? or is it websphere has compatibility issue ?

推荐答案

这个问题需要分为两部分来加以解决。

This issue needs to be solved in 2 parts


  1. Android的侧

  1. Android Side

Android的HttpPost在默认情况下不发送必要的标头,所以我们需要明确地添加页眉,其中最重要的是JSESSIONID当你用会话管理处理为Android与WebSphere服务器..你要做的就是获得JESSIONID从服务器作出反应并它附加到任何进一步的要求,您对服务器。

Android HttpPost by default doesn't send necessary headers , so we need to add headers explicitly , of which the most important is JSESSIONID when your dealing with session management for android with Websphere Servers .. all you got to do is get the JESSIONID from Server Reponse and attach it to any further request that you make to the server .

的Websphere

Websphere

的Websphere需要与重要的特性,这可以通过以下步骤来实现被设置

Websphere needs to be set with important property , which can be achieved by following steps :

一个。打开管理控制台。

a. Open the administrative console.

乙。选择服务器>应用程序服务器>服务器名称>服务器
   基础设施> Java和进程管理>进程定义> Java虚拟机>定制属性>新建。

b. Select Servers > Application Servers > Server_Name > Server Infrastructure > Java and Process Management > Process Definition > Java Virtual Machine > Custom Properties > New.

℃。添加一个新的自定义属性为JVM重用的SessionID:
   系统属性名称:HttpSessionIdReuse系统属性值:true

c. Add a new Custom Property for the JVM to reuse the sessionId: System Property Name: HttpSessionIdReuse System Property Value: true

Ð。保存更改并重新启动应用程序服务器。

d. Save your changes and restart the Application Server.

这篇关于Android的会话迷路了IBM WebSphere服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆