Solved

Sharing session information across two web applications

Posted on 2008-10-06
6
688 Views
Last Modified: 2012-05-05
We have two ASP.net web applications AppA and AppB under the same domain, is it possible to preserve session information from App A to App B ?  Users from AppA are redirected to AppB with information (login and other crtitical data) being transfered by query string to AppB. Now is it possible to maintain reliable distinct session for each user being transfered between the two applications ?

I noticed some user information was being mixed up with the others, is a query string not a good solution for this purpose ?
0
Comment
Question by:byte1
  • 3
  • 2
6 Comments
 
LVL 20

Expert Comment

by:informaniac
ID: 22656605
You could have a look @ storing the Session in a sql server d/b.
0
 

Author Comment

by:byte1
ID: 22656612
Yes, I am aware of that option, but would using the query string transfer method not create a unique session ?
0
 
LVL 20

Expert Comment

by:informaniac
ID: 22656621
How are u sending the session information currently?

Response.Redirect("url"+SessionInfo) ?? something like this?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:byte1
ID: 22656644
yes, thats how i send information over to AppB.

What i am interested in knowing is under the same domain, is every call to AppB unique with a unique session id.
0
 
LVL 20

Expert Comment

by:informaniac
ID: 22656702
If I'm not mistaken, if u r redirecting from appa to appb then the session id should remain the same
0
 
LVL 14

Accepted Solution

by:
Ramuncikas earned 500 total points
ID: 22656845
Hello

As a matter of fact each ASP.NET application has it's own session navigating from AppA to AppB will create a new session on AppB while session on AppA will be still active. Even if SessionIDs on both applications are the same Sessions as instances are two different objects and there is no straight forward way to share info between them. If you come back to AppA from AppB before session expires on AppA you will use the same session object.

Sql Session state management is way to go, but you have to keep in mind to major cons:
 - Sql Session state management is about 30% slower then standard InProc Session state management
 - If you want to use Sql Session state management all objects stored in Session have to be serializable. That means there is no problem to store int, string and even datatable into session. But there is a problem to store custom class becuse and it should implement ISerializable interface

I would suggest you two solutions:
1. Do the same as you do now just take ALL query string, encrypt it and pass encryption result as a query string. Safer but not safe enough.
2. Use database to store/retrieve data to be passed among two applications. This might be slower then query string but safer for sure. And this will be even faster then managing Session state in Sql because Sql Session state management will query database many more times then you storing retrieving data on cross-application navigation

If you use Forms authentication in both of your applications you could also implement Single Sign-on (SSO).
http://www.codeproject.com/KB/web-security/aspnetsinglesignon.aspx
(there are many more articles, just ask google :) )
If additional info you want to have in both applications is user relevant then you could extend Users table and have that info stored/read from there.

HTH
R
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Connecting database in Xamarin? 6 52
Why Does This Page Not Show Up? 4 24
Data is not showing from images 15 37
What namespace do I need to import? 2 8
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now