Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: IIS7
Hi!
 
Guys, in my company we have the scenario bellow:
 
Several applications published in the same IIS virtual directory, using the same "bin" folder to publish the DLL's and under the same application pool.
 
In a long time ago, in a galaxy far, far away, we had to do this because we wanted to share the same session on IIS.
 
But over the years, we gathered a lot of applications under the same virtual directory and started to face some problems:
 
- Everytime we publish a new dll, we shutdown other applications.
- I couldn't publish a 4.0 application without create a new virtual directory, so I had to implement a workaround to make it works.
- The applications share the same webconfig, so we can't create generic tags for them.
 
Now I have a chance to convince my boss to correct the situation. And this is why I need your help. I must point the benefits (performace, best practices, organization, etc) of this kind of change.
 
Could you help me, please?
 
Thank you in advance.
 
Alysson Moulin
Posted 12-Mar-13 3:19am
Edited 12-Mar-13 3:23am
v2
Comments
Zoltán Zörgő at 12-Mar-13 8:28am
   
Sorry, but the original solution was a clear nonsense. Changing to almost anything than that is a benefit.
Marcus Kramer at 12-Mar-13 9:05am
   
Well said.
Alysson Moulin at 12-Mar-13 11:16am
   
Thank you so much! Taking this oportunity, I must suggest a solution to the initial problem: How to share a session between two or more virtual directories? I read about managing the session inside a SQL database or use a cookie to store the authentication information and make the applications consume it. In your opinion what is the best way to solve the problem? Is there another solution?
Zoltán Zörgő at 12-Mar-13 13:48pm
   
Ok. There are several major approaches, without going into details
1) You can use any off-process session management feature to share session even between farm servers
2) If you use domain cookie, all subdomains or virtual directories can read this cookie. You usually can send authentication cookies out, but session cookies are also cookies.
3) Google on ASP.NET SSO (single sign-on). You will find several implementations and method.
Alysson Moulin at 13-Mar-13 11:23am
   
Thank you for your reply. I will search about it!
ryanb31 at 12-Mar-13 8:35am
   
Well, each of the issues you pointed out is the reason best practices say not to do that. I think you already have your answer.
Marcus Kramer at 12-Mar-13 9:05am
   
Nice.
Alysson Moulin at 12-Mar-13 11:16am
   
Thank you so much! Taking this oportunity, I must suggest a solution to the initial problem: How to share a session between two or more virtual directories? I read about managing the session inside a SQL database or use a cookie to store the authentication information and make the applications consume it. In your opinion what is the best way to solve the problem? Is there another solution?
ryanb31 at 12-Mar-13 11:30am
   
I would first revisit the requirement. Why do you need to share session information? Is it for convenience or is there a real business need? A SQL db will work fine and so will query string parameters, it really depends on how you are setup and what type and how much information needs to be shared. Now, if it is just authentication that actually needs to be shared then you can do it with no code using the machinekey in web.config. Sometimes people want to share session information because that is where they have the authentication.
Sergey Alexandrovich Kryukov at 12-Mar-13 11:34am
   
Good point. This is not a question to use the same directory for more then one application, which is technically quite possible; the question is: why?
—SA
Alysson Moulin at 12-Mar-13 13:36pm
   
Thank you for your reply.
I think that the second example is our case. We have an authentication system. The user logs in through it, clicks on the application icon and then the user is redirect to it. We pass the information obtained in the authentication system to the desired application, via session. As we have the same virtual directory the session is maintaned. That is the why we keep all the applications in the same virtual directory.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 575
1 Kornfeld Eliyahu Peter 409
2 Maciej Los 369
3 DamithSL 196
4 OriginalGriff 188
0 OriginalGriff 6,353
1 DamithSL 4,854
2 Maciej Los 4,476
3 Kornfeld Eliyahu Peter 4,058
4 Sergey Alexandrovich Kryukov 3,917


Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 12 Mar 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100