473,545 Members | 2,688 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sharing Session State

I would like to develop an asp.net Web application using muliple web projects under one solution file and share the session information between web applications( or projects). Is this possible?
Nov 18 '05 #1
3 1989
CT
Yes, instead of using Session state, you can use Application state, i.e. you
save to the Application object which is shared among all Web apps on the
server. Alternatively you can implement your own component with shared data.

--
Carsten Thomsen
Enterprise Development with VS .NET, UML, and MSF
http://www.apress.com/book/bookDisplay.html?bID=105
"grooby" <an*******@disc ussions.microso ft.com> wrote in message
news:30******** *************** ***********@mic rosoft.com...
I would like to develop an asp.net Web application using muliple web
projects under one solution file and share the session information between
web applications( or projects). Is this possible?

Nov 18 '05 #2
Hi. I've seen this question a bunch of times, and I was interested in it as well, so I tried to pull together everyone's info.
Session state cannot (and should not) be shared because it would be unsecure to do so. In fact, session data isn't completely secure unless you force an SSL connection. Even then, there are issues with older versions of IIS (5.1 and below) where your session state is lost of you browse from an SSL connection to a non-SSL connection, or vice versa.

Using the application object will persist data in the application collection and make it available to all sessions in an app, but there's no way to restrict access.

So, alternatives to sharing session state seem to be:

- Use a SQL database to persist session variables at the end of each session. This allows for access restrictions. You can use the client's cookie as an identifier if you wish. (from 2 seperate posts)

- Implement your own COM component with shared data. Your apps would call that component.

- Use a message queuing system like MSMQ to save or cache data in a "queue which can either
reside locally or on a dedicated server. Any application can read the queue
once it knows the path to the queue - it typically does
You can store the message in any format from text, to
full blown datasets or custom objects. You can think of the msmq as a robust
caching strategy over a network. It's a good approach because the msmq can
be configured to be fail safe (survive reboots), back up messages, provide
confirmation etc. In addition, msmq can be programmed in a line or two, but
it does require the msmq service to installed and running on the machine." (from "How can I share cached data between web clients?")

- Use the solution in the article at http://www.asp101.com/articles/jayra...te/default.asp. However, one poster said, "you can do what the article suggests without
the massive delete, edit the .webinfo file crap if you set up the parent app
and make the other "apps" subdirs of the parent app (importing, if child
apps already completed). This is really a non-solution for most of us, as
you are essentially killing the child apps and making a single parent app
with all of your applications. You cannot set up the application on a unique
CName, like app1.mydomain.c om, as it is tied to the other apps*. Yuck"

A good topic on MSDN is "State Management Recommendations " at http://msdn.microsoft.com/library/de...tateoption.asp. It outlines some of the options above.
"CT" wrote:
Yes, instead of using Session state, you can use Application state, i.e. you
save to the Application object which is shared among all Web apps on the
server. Alternatively you can implement your own component with shared data.

--
Carsten Thomsen
Enterprise Development with VS .NET, UML, and MSF
http://www.apress.com/book/bookDisplay.html?bID=105
"grooby" <an*******@disc ussions.microso ft.com> wrote in message
news:30******** *************** ***********@mic rosoft.com...
I would like to develop an asp.net Web application using muliple web
projects under one solution file and share the session information between
web applications( or projects). Is this possible?


Nov 18 '05 #3
Hi. I've seen this question a bunch of times, and I was interested in it as well, so I tried to pull together everyone's info.
Session state cannot (and should not) be shared because it would be unsecure to do so. In fact, session data isn't completely secure unless you force an SSL connection. Even then, there are issues with older versions of IIS (5.1 and below) where your session state is lost of you browse from an SSL connection to a non-SSL connection, or vice versa.

Using the application object will persist data in the application collection and make it available to all sessions in an app, but there's no way to restrict access.

So, alternatives to sharing session state seem to be:

- Use a SQL database to persist session variables at the end of each session. This allows for access restrictions. You can use the client's cookie as an identifier if you wish. (from 2 seperate posts)

- Implement your own COM component with shared data. Your apps would call that component.

- Use a message queuing system like MSMQ to save or cache data in a "queue which can either
reside locally or on a dedicated server. Any application can read the queue
once it knows the path to the queue - it typically does
You can store the message in any format from text, to
full blown datasets or custom objects. You can think of the msmq as a robust
caching strategy over a network. It's a good approach because the msmq can
be configured to be fail safe (survive reboots), back up messages, provide
confirmation etc. In addition, msmq can be programmed in a line or two, but
it does require the msmq service to installed and running on the machine." (from "How can I share cached data between web clients?")

- Use the solution in the article at http://www.asp101.com/articles/jayra...te/default.asp. However, one poster said, "you can do what the article suggests without
the massive delete, edit the .webinfo file crap if you set up the parent app
and make the other "apps" subdirs of the parent app (importing, if child
apps already completed). This is really a non-solution for most of us, as
you are essentially killing the child apps and making a single parent app
with all of your applications. You cannot set up the application on a unique
CName, like app1.mydomain.c om, as it is tied to the other apps*. Yuck"

A good topic on MSDN is "State Management Recommendations " at http://msdn.microsoft.com/library/de...tateoption.asp. It outlines some of the options above.

"CT" wrote:
Yes, instead of using Session state, you can use Application state, i.e. you
save to the Application object which is shared among all Web apps on the
server. Alternatively you can implement your own component with shared data.

--
Carsten Thomsen
Enterprise Development with VS .NET, UML, and MSF
http://www.apress.com/book/bookDisplay.html?bID=105
"grooby" <an*******@disc ussions.microso ft.com> wrote in message
news:30******** *************** ***********@mic rosoft.com...
I would like to develop an asp.net Web application using muliple web
projects under one solution file and share the session information between
web applications( or projects). Is this possible?


Nov 18 '05 #4

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

Similar topics

3
2891
by: Hardik Shah | last post by:
Hi, I am calling an ASP.Net page from an ASP classic application but need the .Net page to have access to ASP classic's session variables. I am using HTTPWebRequest to call ASP classic page which could then return the session values. But the values are always blank. If I do a Response.Redirect() to call the ASP page, it returns the values...
4
2592
by: Daniel | last post by:
Hi I am having a problem sharing session between SSL and non-SSL asp.net pages I have F5 BigIP with sticky sessions working fine, but the problem is tha sticky session applies at the port level (80 vs. 443) so when a user goes t a SSL page I lose session vars because it's on another server on the farm When the user stays on the same server...
10
2201
by: Suresh | last post by:
how to share Session Sharing Across the domain
0
1325
by: Daniel Malcolm | last post by:
Hi I have a site where I would like some pages to be accessed via SSL (login and payment etc) and others via regular http. However I'm not sure whether Session state can be maintained between the 2 protocols. We have SSL set up on the site so that it can be accessed via the same domain: http://www.mydomain.com/login.aspx
0
1627
by: Nabani Silva | last post by:
Hi, hope someone could help I need to share session state (and contents) through differente web applications. I'm trying to get it done by using StateServer session state, below I paste code for web.config. Both applications are on the same server (I don't want to include all applications into one common virtual directory or application)
4
2330
by: qube3 | last post by:
We have applications written by JSP/Servlet and ASP.NET. All our future development would be based on ASP.NET. We wants to develop a single user interface so that users would not be aware that some of the modules they are using are implement by JSP or ASP.NET (e.g. no need to login both JSP and ASP.NET applications)? Are there any...
7
4389
by: Nils Hedström | last post by:
I have a web farm that uses a state server for session management. A user logs on to a website (www1.mysite.com). When the same user visits www2.mysite.com I want the user to be logged in. Right now it he is not logged in on www2.mysite.com (both sites use the same state server). The reason for this seems to be that the user gets a new...
5
2699
by: oliv | last post by:
Hi, New to .NET, I was wondering what was the proper way to share a variable between all the instances of a web page. I try with a static var, but it does not seem to always work. Why is that ? public partial class _Default : System.Web.UI.Page {
3
4908
by: =?Utf-8?B?U2FjaGluIFNha2k=?= | last post by:
Hi, Our application have asp and .aspx pages, we need to redirect user from asp page to .aspx page and vice-versa and want to share session state b/w asp and asp.net. This could be achieved by storing the session state in database. I have few quires on this. 1) What happen if asp session and asp.net session time out limit is different ? for...
0
7434
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7692
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7946
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7457
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7791
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5360
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3470
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1045
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
744
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.