share session between more than one web application

Discussion in 'ASP .Net' started by =?Utf-8?B?QWhtZWQ=?=, Sep 16, 2005.

  1. 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?
     
    =?Utf-8?B?QWhtZWQ=?=, Sep 16, 2005
    #1
    1. Advertising

  2. 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!
    ***************************


    "Ahmed" wrote:

    > 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?
     
    =?Utf-8?B?Q293Ym95IChHcmVnb3J5IEEuIEJlYW1lcikgLSBN, Sep 16, 2005
    #2
    1. Advertising

  3. =?Utf-8?B?QWhtZWQ=?=

    Damien Guest

    Cowboy (Gregory A. Beamer) - MVP wrote:
    > "Ahmed" wrote:
    >
    > > 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?

    > 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
     
    Damien, Sep 16, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Merciadri Luca
    Replies:
    4
    Views:
    834
  2. Anupa
    Replies:
    0
    Views:
    150
    Anupa
    Mar 26, 2006
  3. Saraswati lakki
    Replies:
    0
    Views:
    1,369
    Saraswati lakki
    Jan 6, 2012
  4. Steven D'Aprano
    Replies:
    0
    Views:
    116
    Steven D'Aprano
    Dec 23, 2013
  5. Replies:
    3
    Views:
    98
    Gary Herron
    Dec 23, 2013
Loading...

Share This Page