472,782 Members | 1,335 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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 1934
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*******@discussions.microsoft.com> wrote in message
news:30**********************************@microsof t.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.com, 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*******@discussions.microsoft.com> wrote in message
news:30**********************************@microsof t.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.com, 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*******@discussions.microsoft.com> wrote in message
news:30**********************************@microsof t.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
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...
4
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...
10
by: Suresh | last post by:
how to share Session Sharing Across the domain
0
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...
0
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...
4
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...
7
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...
5
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 ? ...
3
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...
0
by: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.