Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 8th, 2006, 07:47 AM
Authorized User
Points: 285, Level: 5
Points: 285, Level: 5 Points: 285, Level: 5 Points: 285, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2005
Location: , , .
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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!!

Reply With Quote
  #2 (permalink)  
Old March 8th, 2006, 02:31 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

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?
Reply With Quote
  #3 (permalink)  
Old March 8th, 2006, 03:36 PM
Authorized User
Points: 285, Level: 5
Points: 285, Level: 5 Points: 285, Level: 5 Points: 285, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2005
Location: , , .
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.

Reply With Quote
  #4 (permalink)  
Old March 8th, 2006, 03:40 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

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?
Reply With Quote
  #5 (permalink)  
Old March 8th, 2006, 03:47 PM
Authorized User
Points: 285, Level: 5
Points: 285, Level: 5 Points: 285, Level: 5 Points: 285, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2005
Location: , , .
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Do you have another solution which would secure it a little better?

Reply With Quote
  #6 (permalink)  
Old March 8th, 2006, 03:49 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

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?
Reply With Quote
  #7 (permalink)  
Old March 8th, 2006, 04:09 PM
Authorized User
Points: 285, Level: 5
Points: 285, Level: 5 Points: 285, Level: 5 Points: 285, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2005
Location: , , .
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
Default

???

Didnt know it has, do you have any documentation???

Reply With Quote
  #8 (permalink)  
Old March 8th, 2006, 04:25 PM
Authorized User
Points: 285, Level: 5
Points: 285, Level: 5 Points: 285, Level: 5 Points: 285, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2005
Location: , , .
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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).

Reply With Quote
  #9 (permalink)  
Old March 8th, 2006, 04:26 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

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?
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Session Variables in C# shikha09 C# 1 November 28th, 2006 10:38 AM
Is it possible for me using session variables into see07 ASP.NET 1.x and 2.0 Application Design 4 March 9th, 2005 07:46 PM
Session Variables - help? Annoyamouse BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 11 August 31st, 2004 03:56 PM
Session Variables flesh_god Dreamweaver (all versions) 7 November 11th, 2003 05:52 PM
session variables help face Classic ASP Databases 4 September 12th, 2003 03:57 PM



All times are GMT -4. The time now is 09:12 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.