Session variables lost on WWW site

G

gfuller

- We have 2 aspx pages in a .NET project. The first sets
a session variable and has a button that when clicked
performs a 'redirect' to the second page which then reads
the session variable.

Problem: This always works fine on the localserver and
through the IDE. But when the application is put onto a
www website, the following occurs;
- If you browse to the site using the IP address, session
variables work fine
- If you browse to the site using the Web Site Domain Name
(ie http://www.tmcontrol.com) session variables are NOT
retrieved properly. Further investigation included
outputting the value of Session.SessionID. In the cases
where session variables were working (IP browsing) the
SessionID matches for both pages. In the case of failure
(name browsing), the SessionIDs are different indicating a
new session.

We tried to workaround this issue by setting SessionState
cookieless to "true" in web.config and while this seems to
correct the session problem, it causes problems with Form
data being returned from Verisign in later processing.

Are losing days and patience on this problem...any help
appreciated!!
 
J

Jim Mitchell

Are you using an ISP? Some ISP's run on load balanced servers and can have
problems with session variables. They may not work on a web farm. You can
build your own session state on the server and pass one ID from page to page
that can be used to retrieve session info stored on your db on the server.
As an alternative to passing the variable from page to page, you can store
the ID in a cookie.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top