5,401,186 members and growing! (18,222 online)
Email Password   helpLost your password?
Web Development » ASP.NET » General     Intermediate

Sharing session state over multiple ASP.NET applications

By SampoSoft

This is an article that explains how to share session variables over multiple applications.
.NET 1.0, .NET 1.1, Win2K, WinXP, Win2003, Windows, .NET, ASP.NET, Visual Studio, Dev

Posted: 11 Sep 2003
Updated: 11 Sep 2003
Views: 46,615
Bookmarked: 17 times
Announcements
Want a new Job?



Search    
Advanced Search
Sitemap
23 votes for this Article.
Popularity: 1.64 Rating: 1.20 out of 5
20 votes, 87.0%
1
1 vote, 4.3%
2
0 votes, 0.0%
3
0 votes, 0.0%
4
2 votes, 8.7%
5
Note: This is an unedited contribution. If this article is inappropriate, needs attention or copies someone else's work without reference then please Report This Article

Introduction

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.

<!-- 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".
-->
<sessionState 
mode="SQLServer"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
cookieless="false" 
timeout="20" 
/>

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

License

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

SampoSoft



Occupation: Web Developer
Location: Italy Italy

Other popular ASP.NET articles:

Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
 Msgs 1 to 7 of 7 (Total in Forum: 7) (Refresh)FirstPrevNext
Subject  Author Date 
GeneralDetailmemberaqua19821:44 2 Jun '08  
GeneralExtra Information need on thismemberSachin Pisal19:34 16 Aug '05  
GeneralThanks!sussshroomy7:35 11 Jun '04  
GeneralHow can I to know my Web Application's AppNamememberCesar Briano9:09 1 Nov '03  
GeneralRe: How can I to know my Web Application's AppNamemember.NET Follower0:11 21 Jan '04  
GeneralNot exactly safe and reliablesussAnonymously16:15 12 Sep '03  
GeneralDoesn't explainmemberdog_spawn14:11 12 Sep '03  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 11 Sep 2003
Editor:
Copyright 2003 by SampoSoft
Everything else Copyright © CodeProject, 1999-2008
Web19 | Advertise on the Code Project