C# Session State in all projects

  • Thread starter Thread starter Alexandre
  • Start date Start date
A

Alexandre

Hi,
I have some projects (webs applications)
and i want to shared Session between the projects but, they are differents
"dll/aplications". Like this:
Session["user"] i want to see then value in all applications
how can i do this?
Using sql-server? How?
thanks a lot....

---------------------------------------------------------
Alexandre Santos
Softway - Sistemas
Tel: (48) 9101-1167 || (48) 251-8664
(e-mail address removed)
www.softway.com.br
----------------------------------------------------------
 
It seems that you don't understand the meaning of Session variables. A
Session is bind to a specific user, and only one, that access your web
application, so even another user that uses that application cannot see that
variable (but by using a static classes you can do that). Sharing an
information between the users of the same application is done usually
through Application level collection.
So to have an information shared between applications I think you have two
options:
1. bind one application as a client to the second and keep the shared
information at application level in the second
2. use an external repository for that info (DB, file or whatever)
 
Alexandre said:
Hi,
I have some projects (webs applications)
and i want to shared Session between the projects but, they are differents
"dll/aplications". Like this:
Session["user"] i want to see then value in all applications
how can i do this?
Using sql-server? How?
Configure your webapps inside web.config file to use a state server that
would be in memory or use a SQL State server.

See the online help how to do that...

see this section and change it...
<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
cookieless="false" timeout="20"/>


--
 
Back
Top