473,383 Members | 1,739 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

ASP.NET Mobile, Cookieless Sessions, and Load Balancing

I have a WAP site powered by ASP.NET Mobile controls. We're using
cookieless sessions and have an F5 Load Balancer that balances the load
between two web servers.

Every once in a while we'll get the following exception:

System.FormatException: Invalid length for a Base-64 char array. at
System.Convert.FromBase64String(String s) at
System.Web.UI.LosFormatter.Deserialize(String input) at
System.Web.UI.MobileControls.MobilePage.LoadPageSt ateFromPersistenceMedium()
at System.Web.UI.Page.LoadPageViewState() at
System.Web.UI.Page.ProcessRequestMain()

We've configured our F5 to route all traffic to the same machine based
on the session ID in the URL. But what about the first request to the
site?

I suspect what's happening is this. The user's phone loads up the site
and the URL they load has no session ID in it because its the first
request. Any subsequent traffic has a session ID and so the F5 will
always send that traffic to the same machine.

But that machine isn't necessarily the same machine that issued the
original session ID! Since the first request was essentially routed
randomly to one of the two web servers, the F5 won't know to route
additional requests back to that same server since there was no session
ID in the first URL the user requested.

Does anybody agree with this assesment? Any suggestions on how to fix
it?

Nov 19 '05 #1
2 2338
Having zilch for experience with WAP sites and the F5 load balancer,
I cannot be 100% certain that this is the issue but...

If it happens periodically it may be that the ISP that
the mobile device runs its traffic through is running
their own outgoing traffic network proxy server. In PC
based browsers, this causes the load balancer to send
the request to the wrong server in the farm. I "suspect"
that this may be occurring to some of your users.

Purely a guess on my part.

If this is, in fact, the issue, there is a product
called ScaleOut StateServer that can remedy this.

http://www.eggheadcafe.com/articles/scaleout_server.asp

--
Robbe Morris - 2004/2005 Microsoft MVP C#

Earn money answering .NET Framework
messageboard posts at EggHeadCafe.com.
http://www.eggheadcafe.com/forums/merit.asp

<th*********@gmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
I have a WAP site powered by ASP.NET Mobile controls. We're using
cookieless sessions and have an F5 Load Balancer that balances the load
between two web servers.

Every once in a while we'll get the following exception:

System.FormatException: Invalid length for a Base-64 char array. at
System.Convert.FromBase64String(String s) at
System.Web.UI.LosFormatter.Deserialize(String input) at
System.Web.UI.MobileControls.MobilePage.LoadPageSt ateFromPersistenceMedium()
at System.Web.UI.Page.LoadPageViewState() at
System.Web.UI.Page.ProcessRequestMain()

We've configured our F5 to route all traffic to the same machine based
on the session ID in the URL. But what about the first request to the
site?

I suspect what's happening is this. The user's phone loads up the site
and the URL they load has no session ID in it because its the first
request. Any subsequent traffic has a session ID and so the F5 will
always send that traffic to the same machine.

But that machine isn't necessarily the same machine that issued the
original session ID! Since the first request was essentially routed
randomly to one of the two web servers, the F5 won't know to route
additional requests back to that same server since there was no session
ID in the first URL the user requested.

Does anybody agree with this assesment? Any suggestions on how to fix
it?

Nov 19 '05 #2
It turns out that this problem probably isn't due to load balancing.
After examining the log files I've determine that it only happens with
two phones.

These phones are the Motorola 8720 andthe Samsung SGH 427M.

There may be additional phones that cause this error, but we have yet
to see them hit the site.

Any ideas?

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: djluker | last post by:
Does anyone know of a way to implement cookieless sessions in ASP.net by tacking on the session ID to the querystring, rather than setting cookieless="true" in the web.config file? I see that some...
0
by: Nikander Bruggeman | last post by:
Hi, In a situation where I have 2 servers which are load balanced I keep losing session state, although I store the session state in sql server and use a cookieless session, so that the session...
3
by: Scott | last post by:
Hello, we are having problems displaying non-aspx files (images, style sheets) since we have upgraded to the 1.1 framework when using a cookieless session (sessionID in the url). Check out...
4
by: DeeAnn | last post by:
We've encountered a "flaky" situation with a Session variable holding a data set on load balanced servers; server session with cookies is set up. Background: Session variable holds a dataset. ...
2
by: Tom Pester | last post by:
I experimented/researched cookieless sessions and tried it on my website. I expected the switch to cookieless sessions to be transparent but this isn' t the case at all: 1) Forms based...
2
by: Steve Franks | last post by:
According to the docs you tell ASP.NET to use cookieless sessions by setting a value in the config.web file. However, what if I wanted to determine at run time whether or not I wanted to use...
10
by: Anthony Williams | last post by:
Hi gang, This one looks like a bug :o( As you may or may not know, setting session management in web.config to use cookieless sessions causes the ASP.NET runtime to munge a session ID into...
2
by: rk325 | last post by:
I have a question about cookies & browser permissions and turning off cookies when creating a web site (cookieless mode in web.config). I have a web site that of course uses Session variables....
0
by: David H. | last post by:
Is there any way to have a user use cookieless sessions at runtime on a case-by-case basis? Or do cookieless sessions have to be turned on globally in the web.config for all users of the web...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.