• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1062
  • Last Modified:

Sharing session data between application

Hi,

I would appriciate if some can help me implement a the best way to share session data between several asp.net applications.

best regards,
Ahamed
0
ahamedmohideen
Asked:
ahamedmohideen
  • 3
  • 3
  • 2
2 Solutions
 
darjimaulikCommented:
Hi Ahamed,

sharing the Session depends on different things.
First Why you want to share?
and Second What you want to share in Session Values?

There are 2 different approach I would suggest.
First one is change the folder structure/ Architecture of the Application. so there will be a main website and then you can add diff application as Folders. As there will be Single application, you can easily share the Session across the projects.

Like
Solution : MySolution  (Which includes different Application as projects)
Projects: Project1, Project2 etc..

Second approach:
If you can't combined the application as they are from different platform like classic asp and asp.net. Then you should use database method to store the sessions and retrieve.

You should save the (Whole session object) session value in DB from the ASP page. and then redirect to the asp.net page with session id in querystring. once on aspx page retrieve the session values from the database based on the sessionid in querystring.
0
 
ahamedmohideenAuthor Commented:
Hi darjimaulik,

Thanks for response. All applications are asp.net apps on a web farm. Unfortunatley its not possible to rearrange the folder structure. I am looking for a solution ( code ) that works something like a Session Server.

I started building a Windows service. Due to security reasons I dont want pass the session id in the querystring and the requirement is also not to pass the session id in a hidden field of the aspx page.

For the moment I can't think of a good solution to pass the session id. Can you please give me some idea? Help with sample code will be very much appreciated.

Best regards,
Ahamed
0
 
Roopesh ReddyCommented:
Hi,

Sharing Session Data in better way is to use SQLServer Mode!

MSDN article - http://blogs.msdn.com/b/toddca/archive/2007/01/25/sharing-asp-net-session-state-across-applications.aspx

Hope it helps u...
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
darjimaulikCommented:
Hi Ahamed,

Is it a single Application deployed in a web farm or you have multiple application working in a web farm.

If its a Single Application deployed in a web farm then you can definitely go for a State Server (A Separate server which manages the session for all your servers) or you can use SQL Server to manage your Sessions.
Below is the link where you can find good details of Session Management.
http://www.codeproject.com/Articles/7182/Session-management-options-in-ASP-NET

for Multiple Applications

http://stackoverflow.com/questions/2402785/sharing-session-state-between-2-asp-net-applications-using-sql-server
0
 
ahamedmohideenAuthor Commented:
Hi darjimaulik,

Sorry for late response. I want  to share between Several apps over a webfarm. I will have alook on the links you posted and get back to you.

best regards,
Ahamed
0
 
Roopesh ReddyCommented:
Hi,

The SQL Server will be the option for you!

Hope it helps u...
0
 
darjimaulikCommented:
Hi Ahamed,
As the 2nd Link in my post suggest you have to use SQL Server when you want to share a session between 2 Application.

The Only disadvantage of using SQL server is reading and writing from SQL server is resource and time consuming.
I hope you dont have a very large application where you need to manage more than 1000 session at a single time.
0
 
ahamedmohideenAuthor Commented:
Thanks for all you help. This inspired me to write my own sessionstateprovider using ms velocity ctp3
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

  • 3
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now