 |
| Visual Studio 2005 For discussing Visual Studio 2005. Please post code questions about a specific language (C#, VB, ASP.NET, etc) in the correct language forum instead. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Visual Studio 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

March 8th, 2006, 07:47 AM
|
|
Authorized User
|
|
Join Date: Dec 2005
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Session Variables
Hi folks,
Nice and easy question now. I need to create two session variables that will store the username and password of a user, and these session variables need to be accessed globaly from 6 other web applications running on the same box.
I am using Visual Studio 2005, with VB, and running Win2k3 Server with IIS6.
Anyone got any ideas/code exmaples please send them this way.
THANKS!!
|
|

March 8th, 2006, 02:31 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
You won't be able to do that directly with .NET.
In each session store (e.g. in proc, state server and SQL Server), .NET keeps track of the app that stores the state. Only for that app will the session variables be returned.
However, Session state is a provider model too, so you could write your own session state provider and plug it into the applications. The provider code would then access a data store and return the data for each of the applications.
Not an easy undertaking.... Why do you need this? There may be better or easier ways to accomplish something like this...
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Lady Of The Flowers by Placebo (Track 9 from the album: Placebo) What's This?
|
|

March 8th, 2006, 03:36 PM
|
|
Authorized User
|
|
Join Date: Dec 2005
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi Imar again ;)
Basically I am using two session variables to store a username and password from a login screen, to plug directly into the data connections i have throughout my web application. Now this is working without a problem but as soon as i reference a different web application which the username and password need to be plugged into the data connection it handles it as a new session so clears both of the session variables I set.
Now luckerly I have managed to sort this out by not using session variables but by using a temp cookie to store the two variables in and it seems to be working ok.
|
|

March 8th, 2006, 03:40 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Great, although storing a user name and a password as clear text in a cookie seems like an insecure solution to me....
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: My Gift To You by KoRn (Track 14 from the album: Follow The Leader) What's This?
|
|

March 8th, 2006, 03:47 PM
|
|
Authorized User
|
|
Join Date: Dec 2005
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Do you have another solution which would secure it a little better?
|
|

March 8th, 2006, 03:49 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Is there a reason why you're not using the built-in ASP.NET authentication? That's more secure, and a lot easier to implement (just enable it).
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: 5 Years by Björk (Track 6 from the album: Homogenic) What's This?
|
|

March 8th, 2006, 04:09 PM
|
|
Authorized User
|
|
Join Date: Dec 2005
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
???
Didnt know it has, do you have any documentation???
|
|

March 8th, 2006, 04:25 PM
|
|
Authorized User
|
|
Join Date: Dec 2005
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
From looking at what I have founf on the net, its only for Windows and Passport authentication. Although look at the Form authentication seems interesting. Not too sure who I would implement this as the user accounts I use or AS400 accounts (UNIX).
|
|

March 8th, 2006, 04:26 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
This is a nice start:
http://www.asp.net/QuickStart/aspnet...y/default.aspx
After the introduction, there are like a billion other articles out on the internet that can help you further.
The Quick Start should be enough to whet your appetite and give you enough "names" and other concepts to search...
ASP.NET 2.0 contains a lot of functionality out-of-the box: Login controls, CreateUserWizard, PasswordRecovery and so on.... I am sure you'll like it.
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: The Witness Song by Nick Cave & the Bad Seeds (Track 8 from the album: The Good Son) What's This?
|
|
 |