share session between more than one web application

G

Guest

Dear All,
I have three web applications that I want to provide one single web
interface to all of them.
If I am able to share the session between them, It will be great. so is this
possibel?
 
G

Guest

You can and can't do what you desire. You can initiate a single sign on
mechanism by using the same encryption keys and cookie name for your
applications. This works well when the apps are on the same machine or web
farm.

Session variables, however, cannot be shared. There are a couple of ways
around this:

1. Set up a service that holds the session key along with pertinent session
information. Call that service when an application does not have the
information and keep the information in session in each app.

2. Place data in a database when the first app is hit. If a second app is
missing session info, grab it. This is essentially the same as version 1, but
the database is the key link.

NOTE: Try to persist as little data as possible.

Another option, if everything is under the same domain name, is to set up
cookies that can be read across apps.

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

***************************
Think Outside the Box!
***************************
 
D

Damien

Cowboy said:
You can and can't do what you desire. You can initiate a single sign on
mechanism by using the same encryption keys and cookie name for your
applications. This works well when the apps are on the same machine or web
farm.

Session variables, however, cannot be shared. There are a couple of ways
around this:

1. Set up a service that holds the session key along with pertinent session
information. Call that service when an application does not have the
information and keep the information in session in each app.

2. Place data in a database when the first app is hit. If a second app is
missing session info, grab it. This is essentially the same as version 1, but
the database is the key link.

NOTE: Try to persist as little data as possible.

Another option, if everything is under the same domain name, is to set up
cookies that can be read across apps.

I'm currently working on something that might be considered to be 6
seperate web applications. It's composed of about 10 different projects
now. Some of these are plain class libraries, which encapsulate
functionality that is used by more than one of the web projects.

One is a basic web project that just references the other web projects.
It lives in a virtual directory of IIS, and is the only one marked as
an application. The others live in subdirectories (and I have to go
into IIS manager every time I add a new one and turn *off* the
application for these, and delete web.config from these directories).

Login is done within the basic root project. It then redirects to
either a) The project which the user is authorised to use, or b) a
selection page, if they are authorised for multiple projects.

Session is shared, single sign on works, and where webprojects don't
need to know about each other, they're not referenced by each other.
Disadvantages: There is only one application. If you need to recycle
one of the projects, you have to recycle all of them. I suppose I could
use additional web.configs within the subdirectories if I needed to
vary some of the behaviour, but so far one web.config has met all of my
needs.

Damien
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top