Link to home
Start Free TrialLog in
Avatar of ahamedmohideen
ahamedmohideenFlag for Austria

asked on

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
Avatar of darjimaulik
darjimaulik
Flag of India image

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.
Avatar of ahamedmohideen

ASKER

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
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...
ASKER CERTIFIED SOLUTION
Avatar of darjimaulik
darjimaulik
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
Thanks for all you help. This inspired me to write my own sessionstateprovider using ms velocity ctp3