BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 06-17-2010, 05:42 AM   #1
anuj866
Knows Where the Search Button Is
 
Join Date: Feb 2010
Model: 7100t
PIN: N/A
Carrier: VODAFONE
Posts: 18
Default Session maintenance and cookie management or MDS alteration

Please Login to Remove!

Hello BB experts,

I perform login operation using "My application" on Web Service which on success returns back an I.D.(in the body) and Cookie value(in header) .

The Problem starts from here, after the successful login when i try to perform other functions on that web Service (which of course requires that i am a logged in user ) the web service would not recognize me as a logged in user and Asks me to log in


I am using http connection to send and receive data on the service.

and let me inform that in the rimpublic.property file i have changed

application.handler.http.CookieSupport = false

the whole application works fine when the CookieSupport=true is kept ,but this is undesirable as it wouldn't work on the device.

please help me out with this have been stuck in this for long.
Offline  
Old 06-18-2010, 05:10 PM   #2
Dougsg38p
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Default

You have to manage the cookies yourself, if you are planning to run in a non-BIS, non-BES environment.

You store the cookies, along with the base URL, and return them on each and every request to that base URL.
Offline  
Old 06-21-2010, 03:58 AM   #3
anuj866
Knows Where the Search Button Is
 
Join Date: Feb 2010
Model: 7100t
PIN: N/A
Carrier: VODAFONE
Posts: 18
Default

perfect....thats what i tried and it works exactly as i wanted it to work....

but there is just one more problem , it is working fine on the simulator , not on the device..

m still to find the reason why.
if u have any inputs that mite help me with this, please do let me know.

and thanks for the help provided uptill now....
Offline  
Old 06-21-2010, 07:17 AM   #4
Dougsg38p
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Default

What is not working on the device? Are you getting an error?

Do you mean that you cannot establish a connection, or that your cookie management doesn't work?
Offline  
Old 06-21-2010, 08:21 AM   #5
anuj866
Knows Where the Search Button Is
 
Join Date: Feb 2010
Model: 7100t
PIN: N/A
Carrier: VODAFONE
Posts: 18
Default

ok the problem lies in the cookie management , it seems that the caching mech. is done and the same cookie is sent to the application instead of the second cookie.

FIRSTLY,
when using a browser(setting to get notifications for each and every COOKIE) the web-site is responding with TWO different cookies.

1) login=3 *i.e. login id*
2)loginCookies= <dynamically generated> *which maintains the session for login*

These two cookies are made one and sent from mds to device when the mds is made to act in cookieSupport (that is what i observed)


but,on device, the device receives two separate cookies (as in a general browser)
It would have been fine if the cookies received were like the browser but the device gets both cookies as same(duplicate) which restricts me from getting the logincookie

please refer below for the obtained headers




HEADER--------->Date
VALUE--------->Mon, 21 Jun 2010 12:22:59 GMT
HEADER--------->Server
VALUE--------->Apache/2.2.15 (CentOS) mod_ssl/2.2.15 0.9.8l DAV/2 mod_auth_passthrough/2.1 FrontPage/5.0.2.2635
HEADER--------->SOAPServer
VALUE--------->SOAP::Lite/Perl/0.710.08
HEADER--------->Set-Cookie
VALUE--------->login=3; path=/; expires=Fri, 01-Jan-2038 00:00:00 GMT

*THIS IS THE DUPLICATE COOKIE VALUE*

HEADER--------->Set-Cookie
VALUE--------->login=3; path=/; expires=Fri, 01-Jan-2038 00:00:00 GMT
HEADER--------->Content-Length
VALUE--------->194
HEADER--------->Vary
VALUE--------->Accept-Encoding
HEADER--------->Connection
VALUE--------->close
HEADER--------->Content-Type
VALUE--------->text/xml

i even used
connection. setRequestProperty("Cache-Control", "no-store, no-cache, must-revalidate");

but it seems that there is no change in the response header.

any ideas as to where m i going wrong??

thanks in advance
Offline  
Old 06-22-2010, 02:47 AM   #6
anuj866
Knows Where the Search Button Is
 
Join Date: Feb 2010
Model: 7100t
PIN: N/A
Carrier: VODAFONE
Posts: 18
Default

Quote:
Originally Posted by anuj866 View Post
ok the problem lies in the cookie management , it seems that the caching mech. is done and the same cookie is sent to the application instead of the second cookie.

FIRSTLY,
when using a browser(setting to get notifications for each and every COOKIE) the web-site is responding with TWO different cookies.

1) login=3 *i.e. login id*
2)loginCookies= <dynamically generated> *which maintains the session for login*

These two cookies are made one and sent from mds to device when the mds is made to act in cookieSupport (that is what i observed)


but,on device, the device receives two separate cookies (as in a general browser)
It would have been fine if the cookies received were like the browser but the device gets both cookies as same(duplicate) which restricts me from getting the logincookie

please refer below for the obtained headers




HEADER--------->Date
VALUE--------->Mon, 21 Jun 2010 12:22:59 GMT
HEADER--------->Server
VALUE--------->Apache/2.2.15 (CentOS) mod_ssl/2.2.15 0.9.8l DAV/2 mod_auth_passthrough/2.1 FrontPage/5.0.2.2635
HEADER--------->SOAPServer
VALUE--------->SOAP::Lite/Perl/0.710.08
HEADER--------->Set-Cookie
VALUE--------->login=3; path=/; expires=Fri, 01-Jan-2038 00:00:00 GMT

*THIS IS THE DUPLICATE COOKIE VALUE*

HEADER--------->Set-Cookie
VALUE--------->login=3; path=/; expires=Fri, 01-Jan-2038 00:00:00 GMT
HEADER--------->Content-Length
VALUE--------->194
HEADER--------->Vary
VALUE--------->Accept-Encoding
HEADER--------->Connection
VALUE--------->close
HEADER--------->Content-Type
VALUE--------->text/xml

i even used
connection. setRequestProperty("Cache-Control", "no-store, no-cache, must-revalidate");

but it seems that there is no change in the response header.

any ideas as to where m i going wrong??

thanks in advance






while in the MDS-SIMULATOR i can very clearly see:

<2010-06-22 13:10:33.520 IST>:[201]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = SentToDevi
ce, DEVICEPIN = 2100000a, CONNECTIONID = 87478366, HTTPTRANSMISSION = Set-Cookie:login=3; path=/;
expires=Fri, 01-Jan-2038 00:00:00 GMT
>
<2010-06-22 13:10:33.520 IST>:[201]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = SentToDevi
ce, DEVICEPIN = 2100000a, CONNECTIONID = 87478366, HTTPTRANSMISSION = Set-Cookie:logincookie=mZdW
JIk5V0; path=/; expires=Fri, 01-Jan-2038 00:00:00 GMT
>

i dont understand why the device Cant get the same response as the MDS-simulator.
does anyone know how to remove that duplication m receiving and get the real cookies as the MDS-simultor??
please help
Offline  
Old 06-22-2010, 08:05 AM   #7
anuj866
Knows Where the Search Button Is
 
Join Date: Feb 2010
Model: 7100t
PIN: N/A
Carrier: VODAFONE
Posts: 18
Default

OOps !!

m embarassed to say that it was my mistake in receiving the other cookie.

finally m done with the app. and maintaining its session....

CHEERS!!!
Offline  
Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


Schneider Electric Energy Server EBX510 Server For Energy Management- picture

Schneider Electric Energy Server EBX510 Server For Energy Management-

$4350.00



FANUC Server Driver A06B-6117-H211 picture

FANUC Server Driver A06B-6117-H211

$3993.99



SERVER TECHNOLOGY 4870-XLS-44 SENTRY VDC 48VOLT DC REMOTE POWER MANAGER picture

SERVER TECHNOLOGY 4870-XLS-44 SENTRY VDC 48VOLT DC REMOTE POWER MANAGER

$299.99



Server SE-SS 07020 Server Express Single Drop-In - NEW - COMPLETE - Genuine OEM picture

Server SE-SS 07020 Server Express Single Drop-In - NEW - COMPLETE - Genuine OEM

$180.00



USA Windows VPS Server / RDP Server / VPS Hosting 12GB RAM 400GB HDD 12 Month picture

USA Windows VPS Server / RDP Server / VPS Hosting 12GB RAM 400GB HDD 12 Month

$335.00



Intel S2600CP2 Server Board DBS2600CP2 with cables, FW CD docs picture

Intel S2600CP2 Server Board DBS2600CP2 with cables, FW CD docs

$224.00







Copyright © 2004-2016 BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of BlackBerry Inc.