Click here to Skip to main content
14,697,269 members
Articles » Web Development » ASP.NET » General
Posted 11 Sep 2003


25 bookmarked

Sharing session state over multiple ASP.NET applications

Rate me:
Please Sign up or sign in to vote.
1.03/5 (24 votes)
11 Sep 2003
This is an article that explains how to share session variables over multiple applications.


I have modified the SQL script that create the SQL Server Database for storing the ASP.NET session state.

Using the code

In web.config you must change the sessionState from "InProc" to "SQLServer" and specify the correct SQL connection string.

<!--<span class="code-comment"> SESSION STATE SETTINGS
By default ASP.NET uses cookies to identify which requests 
belong to a particular session. 
If cookies are not available, a session can be tracked 
by adding a session identifier to the URL. 
To disable cookies, set sessionState cookieless="true".
sqlConnectionString="data source=;Trusted_Connection=yes"

I have added a table named ASPStateApplications that can be used to set the applications that share the session state.

Sample Image - Sharing_session_state.jpg


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Web Developer
Italy Italy
No Biography provided

Comments and Discussions

QuestionSession does not work among two application sharing two diffrent IPs and Header value. any solutuion ? Pin
MyRitu13-Apr-09 21:35
MemberMyRitu13-Apr-09 21:35 
GeneralDetail Pin
aqua19822-Jun-08 1:44
Memberaqua19822-Jun-08 1:44 
GeneralExtra Information need on this Pin
sacp.net16-Aug-05 19:34
Membersacp.net16-Aug-05 19:34 
GeneralThanks! Pin
shroomy11-Jun-04 7:35
Membershroomy11-Jun-04 7:35 
QuestionHow can I to know my Web Application's AppName Pin
cbriano1-Nov-03 9:09
Membercbriano1-Nov-03 9:09 
AnswerRe: How can I to know my Web Application's AppName Pin
.NET Follower21-Jan-04 0:11
Member.NET Follower21-Jan-04 0:11 
GeneralNot exactly safe and reliable Pin
Anonymously12-Sep-03 16:15
MemberAnonymously12-Sep-03 16:15 
GeneralDoesn't explain Pin
dog_spawn12-Sep-03 14:11
Memberdog_spawn12-Sep-03 14:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.