How to Maintain Sessions between applications

  • Thread starter Thread starter Moin Syed
  • Start date Start date
M

Moin Syed

Hi,

I have two applications (websites) which are deployed in a Web farm with SQL Server as state server.Now both the websites are launched from a common page (so the session id should be same).

When the user clicks on a particular link on one website, it needs to be redirected to the other site along with the session data. How is it possible?

ps: The session related logic is written in another project (class library) which is common to both the websites.

EggHeadCafe - Software Developer Portal of Choice
WPF And The Model View View Model Pattern
http://www.eggheadcafe.com/tutorial...b-7374d3da3425/wpf-and-the-model-view-vi.aspx
 
Hi,

I have two applications (websites) which are deployed in a Web farm with SQL Server as state server.Now both the websites are launched from a commonpage (so the session id should be same).

When the user clicks on a particular link on one website, it needs to be redirected to the other site along with the session data. How is it possible?

ps: The session related logic is written in another project (class library)  which is common to both the websites.

EggHeadCafe - Software Developer Portal of Choice
WPF And The Model View View Model Patternhttp://www.eggheadcafe.com/tutorials/aspnet/ec832ac7-6e4c-4ea8-81ab-7...

Use StateServer mode, which stores session state in a separate process
called the ASP.NET state service. This ensures that session state is
preserved if the Web application is restarted and also makes session
state available to multiple Web servers in a Web farm.

http://idunno.org/articles/277.aspx
 
session is unique by website (the siteid is part of the key), so each
website has its own session and sessionid's.

you will need to supply a new session manager of your own. you will need
to change the session cookie logic to use a common domain path to store
the sessionid, and then change the session logic to use this cookie to
lookup session data.

note: asp.net queues requests that access the same session, via session
locking. you will have to be sure to implement the locking correctly.

-- bruce (sqlwork.com)
 
Moin Syed wrote in
Hi,

I have two applications (websites) which are deployed in a Web farm
with SQL Server as state server.Now both the websites are launched
from a common page (so the session id should be same).

Wrong. Session id is application specific. Or, more directly, cookie
dependent.

If you set the machine keys identical, and you set up the same name for
the <forms> tag on both machines, you can share a single sign on,
however. said:
When the user clicks on a particular link on one website, it needs to
be redirected to the other site along with the session data. How is it
possible?

Session data will have to be stored to be picked up by the other
application. You cannot use the session variables in the other app, even
if you set it up for single sign on. If anyone knows a way around this,
they need to post, as I have yet to figure a way around this.

The only way I know to share session is have all of the 'applications'
in a single web site.
ps: The session related logic is written in another project (class
library) which is common to both the websites.

You can persist off the values of hte objects and then reconstitute.

peace and race,


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

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

My vacation and childhood cancer awareness site:
http://www.crazycancertour.com

*******************************************
| Think outside the box! |
*******************************************
 
Use StateServer mode, which stores session state in a separate process
called the ASP.NET state service. This ensures that session state is
preserved if the Web application is restarted and also makes session
state available to multiple Web servers in a Web farm.

http://idunno.org/articles/277.aspx

Does that work across applications? I have not tried this since 1.x, so
this is a sincere question. In 1.x, I could share a single cookie (name
under <forms>) in multiple apps, but I could not do this:

string foo = Session["foo"];

Storing session in SQL server will overcome a temporary application
stopage, so I agree with that, but one of the OPs needs was sharing
session amongst various apps.

Peace and Grace,


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

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

My vacation and childhood cancer awareness site:
http://www.crazycancertour.com

*******************************************
| Think outside the box! |
*******************************************
 
Back
Top