473,606 Members | 2,885 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sharing Session variables across applications

Background:
-------------
The idea started as a single sign on type of application. Having tested it
before, I knew we could institute single sign on using the same
Authentication Cookie name (in this case "Authentication Cookie" -- yeah,
original, I know) and the same machine keys for the applications.

<authenticati on mode="Forms">
<forms name="Authentic ationCookie" path="/"
loginUrl="login .aspx" protection="All " timeout="10" />
</authentication>

<machineKey
validationKey=" C50B3C89CB21F4F 1422FF158A5B42D 0E8DB8CB5CDA174 2572A487D9401E3 4
00267682B202B74 6511891C1BAF47F 8D25C07F6C39A10 4696DB51F17C529 AD3CABE"
decryptionKey=" 8A9BE8FD67AF697 9E7D20198CFEA50 DD3D3799C77AF2B 72F"
validation="3DE S"
/>

When a user logs into one application, they can move back and forth between
apps. And, the user uses the same session ID in both applications (confirmed
by output of session ID), so it appears as if he is just moving from section
to section in a single app, rather than moving back and forth between
multiple apps. Everything is fine and beautiful ... until today.

The Problem
-------------
I have a colleague who sets up everything in session variables. As his app
is complete already, moving away from Session variables will be too time
consuming to be a realistic solution. The problem is you cannot share
application variables across app boundaries like so:

APP 1: Session["PassedID"] = UserID;
APP 2: UserID = Convert.ToDecim al(Session["PassedID"]);

The one clue I have is the error messages states something about the wrong
namespace, which suggests to me that the namespace has to be used to pull
the variable. This would mean that there is another syntax to pull Session
vars, otther than:

UserID = Convert.ToDecim al(Session["PassedID"]);

In a nutshell: I need basic syntax to pull from same session, different
application (namespace).

My other ideas:

1. Store to some form of temporary persistant storage (XML File, SQL table,
et al) and use Session ID to pass information back and forth.

2. Try the Caching Application Block and see if the Framework allows cross
application use of information.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************** *************** *************** *************** ***
Think outside the box!
*************** *************** *************** *************** ***
Nov 18 '05 #1
4 2044
'sup Cowboy?

How about using SQL Server to store the Sessions, and then you should be
able to execute queries to get the Session values from the other app?

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Cowboy (Gregory A. Beamer)" <No************ @comcast.netNoS pamM> wrote in
message news:ua******** ******@TK2MSFTN GP11.phx.gbl...
Background:
-------------
The idea started as a single sign on type of application. Having tested it
before, I knew we could institute single sign on using the same
Authentication Cookie name (in this case "Authentication Cookie" -- yeah,
original, I know) and the same machine keys for the applications.

<authenticati on mode="Forms">
<forms name="Authentic ationCookie" path="/"
loginUrl="login .aspx" protection="All " timeout="10" />
</authentication>

<machineKey
validationKey=" C50B3C89CB21F4F 1422FF158A5B42D 0E8DB8CB5CDA174 2572A487D9401E3 4 00267682B202B74 6511891C1BAF47F 8D25C07F6C39A10 4696DB51F17C529 AD3CABE"
decryptionKey=" 8A9BE8FD67AF697 9E7D20198CFEA50 DD3D3799C77AF2B 72F"
validation="3DE S"
/>

When a user logs into one application, they can move back and forth between apps. And, the user uses the same session ID in both applications (confirmed by output of session ID), so it appears as if he is just moving from section to section in a single app, rather than moving back and forth between
multiple apps. Everything is fine and beautiful ... until today.

The Problem
-------------
I have a colleague who sets up everything in session variables. As his app
is complete already, moving away from Session variables will be too time
consuming to be a realistic solution. The problem is you cannot share
application variables across app boundaries like so:

APP 1: Session["PassedID"] = UserID;
APP 2: UserID = Convert.ToDecim al(Session["PassedID"]);

The one clue I have is the error messages states something about the wrong
namespace, which suggests to me that the namespace has to be used to pull
the variable. This would mean that there is another syntax to pull Session
vars, otther than:

UserID = Convert.ToDecim al(Session["PassedID"]);

In a nutshell: I need basic syntax to pull from same session, different
application (namespace).

My other ideas:

1. Store to some form of temporary persistant storage (XML File, SQL table, et al) and use Session ID to pass information back and forth.

2. Try the Caching Application Block and see if the Framework allows cross
application use of information.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************** *************** *************** *************** ***
Think outside the box!
*************** *************** *************** *************** ***

Nov 18 '05 #2
That is the direction I pushed: Create an object with 'void
SetSessionItem( string SessionID, string Key, string Value)', 'string
GetSessionItem( string SessionID, string Key)' and 'DataSet
GetAllSessionIt ems(string SessionID)'. You can then store in any persistant
storage (in this case Oracle, which is the client's standard).

The other developer still wants to set
'Session["AlltheStuffICa nStickInSession "] = someGarbage;' in one app and
then use 'Object someGarbage = Session["AlltheStuffICa nStickInSession "] ' on
the second app. So, if anyone figures out a way to solve this, I would love
a heads up.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************** *************** *************** *************** **********
Think Outside the Box!
*************** *************** *************** *************** **********
"Kevin Spencer" <ke***@takempis .com> wrote in message
news:O3******** ******@TK2MSFTN GP09.phx.gbl...
'sup Cowboy?

How about using SQL Server to store the Sessions, and then you should be
able to execute queries to get the Session values from the other app?

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Cowboy (Gregory A. Beamer)" <No************ @comcast.netNoS pamM> wrote in
message news:ua******** ******@TK2MSFTN GP11.phx.gbl...
Background:
-------------
The idea started as a single sign on type of application. Having tested it before, I knew we could institute single sign on using the same
Authentication Cookie name (in this case "Authentication Cookie" -- yeah,
original, I know) and the same machine keys for the applications.

<authenticati on mode="Forms">
<forms name="Authentic ationCookie" path="/"
loginUrl="login .aspx" protection="All " timeout="10" />
</authentication>

<machineKey

validationKey=" C50B3C89CB21F4F 1422FF158A5B42D 0E8DB8CB5CDA174 2572A487D9401E3 4
00267682B202B74 6511891C1BAF47F 8D25C07F6C39A10 4696DB51F17C529 AD3CABE"
decryptionKey=" 8A9BE8FD67AF697 9E7D20198CFEA50 DD3D3799C77AF2B 72F"
validation="3DE S"
/>

When a user logs into one application, they can move back and forth

between
apps. And, the user uses the same session ID in both applications

(confirmed
by output of session ID), so it appears as if he is just moving from

section
to section in a single app, rather than moving back and forth between
multiple apps. Everything is fine and beautiful ... until today.

The Problem
-------------
I have a colleague who sets up everything in session variables. As his app is complete already, moving away from Session variables will be too time
consuming to be a realistic solution. The problem is you cannot share
application variables across app boundaries like so:

APP 1: Session["PassedID"] = UserID;
APP 2: UserID = Convert.ToDecim al(Session["PassedID"]);

The one clue I have is the error messages states something about the wrong namespace, which suggests to me that the namespace has to be used to pull the variable. This would mean that there is another syntax to pull Session vars, otther than:

UserID = Convert.ToDecim al(Session["PassedID"]);

In a nutshell: I need basic syntax to pull from same session, different
application (namespace).

My other ideas:

1. Store to some form of temporary persistant storage (XML File, SQL

table,
et al) and use Session ID to pass information back and forth.

2. Try the Caching Application Block and see if the Framework allows cross application use of information.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************** *************** *************** *************** ***
Think outside the box!
*************** *************** *************** *************** ***


Nov 18 '05 #3
Get rid of the other developer?

;-)

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Cowboy (Gregory A. Beamer)" <No************ @comcast.netNoS pamM> wrote in
message news:#N******** ******@TK2MSFTN GP10.phx.gbl...
That is the direction I pushed: Create an object with 'void
SetSessionItem( string SessionID, string Key, string Value)', 'string
GetSessionItem( string SessionID, string Key)' and 'DataSet
GetAllSessionIt ems(string SessionID)'. You can then store in any persistant storage (in this case Oracle, which is the client's standard).

The other developer still wants to set
'Session["AlltheStuffICa nStickInSession "] = someGarbage;' in one app and
then use 'Object someGarbage = Session["AlltheStuffICa nStickInSession "] ' on the second app. So, if anyone figures out a way to solve this, I would love a heads up.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************** *************** *************** *************** **********
Think Outside the Box!
*************** *************** *************** *************** **********
"Kevin Spencer" <ke***@takempis .com> wrote in message
news:O3******** ******@TK2MSFTN GP09.phx.gbl...
'sup Cowboy?

How about using SQL Server to store the Sessions, and then you should be
able to execute queries to get the Session values from the other app?

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Cowboy (Gregory A. Beamer)" <No************ @comcast.netNoS pamM> wrote in
message news:ua******** ******@TK2MSFTN GP11.phx.gbl...
Background:
-------------
The idea started as a single sign on type of application. Having tested
it before, I knew we could institute single sign on using the same
Authentication Cookie name (in this case "Authentication Cookie" --
yeah, original, I know) and the same machine keys for the applications.

<authenticati on mode="Forms">
<forms name="Authentic ationCookie" path="/"
loginUrl="login .aspx" protection="All " timeout="10" />
</authentication>

<machineKey

validationKey=" C50B3C89CB21F4F 1422FF158A5B42D 0E8DB8CB5CDA174 2572A487D9401E3 4
00267682B202B74 6511891C1BAF47F 8D25C07F6C39A10 4696DB51F17C529 AD3CABE"
decryptionKey=" 8A9BE8FD67AF697 9E7D20198CFEA50 DD3D3799C77AF2B 72F"
validation="3DE S"
/>

When a user logs into one application, they can move back and forth

between
apps. And, the user uses the same session ID in both applications

(confirmed
by output of session ID), so it appears as if he is just moving from

section
to section in a single app, rather than moving back and forth between
multiple apps. Everything is fine and beautiful ... until today.

The Problem
-------------
I have a colleague who sets up everything in session variables. As his app is complete already, moving away from Session variables will be too time consuming to be a realistic solution. The problem is you cannot share
application variables across app boundaries like so:

APP 1: Session["PassedID"] = UserID;
APP 2: UserID = Convert.ToDecim al(Session["PassedID"]);

The one clue I have is the error messages states something about the wrong namespace, which suggests to me that the namespace has to be used to pull the variable. This would mean that there is another syntax to pull Session vars, otther than:

UserID = Convert.ToDecim al(Session["PassedID"]);

In a nutshell: I need basic syntax to pull from same session, different application (namespace).

My other ideas:

1. Store to some form of temporary persistant storage (XML File, SQL

table,
et al) and use Session ID to pass information back and forth.

2. Try the Caching Application Block and see if the Framework allows cross application use of information.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************** *************** *************** *************** ***
Think outside the box!
*************** *************** *************** *************** ***



Nov 18 '05 #4
I have a wild idea. how about this:

iterate thru the running applications on the webserver. this will bring back
a list of the running apps. get the attached application object assigned to
each app. with the application object, get the httpcontext object associated
with this, and on down thru to the session object. This is a similar
approach to finding a control in a page, except that it would be starting
with a running application.

There is one fly in the ointment. Classes and the methods are private, so
you could try changing the class specifier to public instead of private.
ya, i know. it's very ugly. but that would conceivably get you passed the
access issue without having to add new code to a completed project. i have
no idea if this will work or if it even makes sense, it's just a thought
requiring a brazen hack. but then again, you are an MVP.

--
Regards,
Alvin Bruney
Got DotNet? Get it here
http://home.networkip.net/dotnet/tidbits/default.htm
"Cowboy (Gregory A. Beamer)" <No************ @comcast.netNoS pamM> wrote in
message news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
That is the direction I pushed: Create an object with 'void
SetSessionItem( string SessionID, string Key, string Value)', 'string
GetSessionItem( string SessionID, string Key)' and 'DataSet
GetAllSessionIt ems(string SessionID)'. You can then store in any persistant storage (in this case Oracle, which is the client's standard).

The other developer still wants to set
'Session["AlltheStuffICa nStickInSession "] = someGarbage;' in one app and
then use 'Object someGarbage = Session["AlltheStuffICa nStickInSession "] ' on the second app. So, if anyone figures out a way to solve this, I would love a heads up.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************** *************** *************** *************** **********
Think Outside the Box!
*************** *************** *************** *************** **********
"Kevin Spencer" <ke***@takempis .com> wrote in message
news:O3******** ******@TK2MSFTN GP09.phx.gbl...
'sup Cowboy?

How about using SQL Server to store the Sessions, and then you should be
able to execute queries to get the Session values from the other app?

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Cowboy (Gregory A. Beamer)" <No************ @comcast.netNoS pamM> wrote in
message news:ua******** ******@TK2MSFTN GP11.phx.gbl...
Background:
-------------
The idea started as a single sign on type of application. Having tested
it before, I knew we could institute single sign on using the same
Authentication Cookie name (in this case "Authentication Cookie" --
yeah, original, I know) and the same machine keys for the applications.

<authenticati on mode="Forms">
<forms name="Authentic ationCookie" path="/"
loginUrl="login .aspx" protection="All " timeout="10" />
</authentication>

<machineKey

validationKey=" C50B3C89CB21F4F 1422FF158A5B42D 0E8DB8CB5CDA174 2572A487D9401E3 4
00267682B202B74 6511891C1BAF47F 8D25C07F6C39A10 4696DB51F17C529 AD3CABE"
decryptionKey=" 8A9BE8FD67AF697 9E7D20198CFEA50 DD3D3799C77AF2B 72F"
validation="3DE S"
/>

When a user logs into one application, they can move back and forth

between
apps. And, the user uses the same session ID in both applications

(confirmed
by output of session ID), so it appears as if he is just moving from

section
to section in a single app, rather than moving back and forth between
multiple apps. Everything is fine and beautiful ... until today.

The Problem
-------------
I have a colleague who sets up everything in session variables. As his app is complete already, moving away from Session variables will be too time consuming to be a realistic solution. The problem is you cannot share
application variables across app boundaries like so:

APP 1: Session["PassedID"] = UserID;
APP 2: UserID = Convert.ToDecim al(Session["PassedID"]);

The one clue I have is the error messages states something about the wrong namespace, which suggests to me that the namespace has to be used to pull the variable. This would mean that there is another syntax to pull Session vars, otther than:

UserID = Convert.ToDecim al(Session["PassedID"]);

In a nutshell: I need basic syntax to pull from same session, different application (namespace).

My other ideas:

1. Store to some form of temporary persistant storage (XML File, SQL

table,
et al) and use Session ID to pass information back and forth.

2. Try the Caching Application Block and see if the Framework allows cross application use of information.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************** *************** *************** *************** ***
Think outside the box!
*************** *************** *************** *************** ***



Nov 18 '05 #5

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

Similar topics

3
1952
by: Dave Ainslie | last post by:
How do I send session variables between two web directories? I have two sites on my web server I wish to send cookies between. Thanks in advance Dave
2
1367
by: PeteZ | last post by:
Hi, I was of the understanding that Session variables were GLOBALLY scoped across all Applications on a specific web site and that data obtained and stored in "variables" were available for other applications - it seems I was wrong. It appears that the data is held on a per-application instance ie. Each applications data is "sand-boxed" from other apps and cannot be referenced.
6
2558
by: Nedu N | last post by:
Hi, I am trying to design a Home page for my applicatiion in which i want show the links for for some itms... I tried to put the following <td> <font face="Arial, Helvetica, sans-serif" color="#ffffff" size="2"> Contact | My Profile | Logout /font> </td>
3
1996
by: grooby | last post by:
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?
3
1334
by: Mothish K | last post by:
Hello, I am trying to connect 2 of my asp.net applications using context.items collections to share the variables. but it says Could not load type 'Proj2.SignIn'. I have set the authentication mode="Forms" but still it says the same..
3
1816
by: Martin Lee | last post by:
I'm looking to carry the session across from one ASP.Net application to another. I'm currently using SQL Server to store session state information. What would be the best way of doing this? Thanks
4
1346
by: W Akthar | last post by:
Hi, I need to pass session state variables across different web applications. Firstly is this possible and secondly can someone show me how please??
5
2438
by: Oleg Ogurok | last post by:
Hi all, Is there a way to read other people's session variables? I understand it makes sense that session state is on per-user basis, but still... Is there a way to get a collection of all current HttpSessionState objects on the server, or at least get a reference to a HttpSessionState objects by session ID ? Thanks.
18
3427
by: BillE | last post by:
When a user opens a new IE browser window using File-New-Window the integrity of an application which relies on session state is COMPLETELY undermined. Anyone who overlooks the fact that File-New-Window creates an instance of IE in the same process with the same SessionID as the parent window is in big trouble. This fundamentally restricts the usefullness of using session state management. I probably missed it somewhere - can...
0
8031
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8456
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
6792
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5971
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5467
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3989
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2452
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1565
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1309
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.