Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP session variable security question

Status
Not open for further replies.

Spork52

Programmer
Nov 20, 2007
134
US
I was told by an MS engineer that every time the browser connects to the server the session variables are sent to the server from the browser (well, actually references to the session variables) and that the way to prevent session hijacking is to force an SSL connection at all times.

So, I am using this code from MS to force SSL connections:

Code:
If Request.ServerVariables("SERVER_PORT") = 80 Then
	Dim strSecureURL
	strSecureURL = "[URL unfurl="true"]https://"[/URL]
	strSecureURL = strSecureURL & Request.ServerVariables("SERVER_NAME")
	strSecureURL = strSecureURL & Request.ServerVariables("URL")
	Response.Redirect strSecureURL
End If
'Assumes the following conditions:
'- IIS is running on standard ports:
'- HTTP = Port 80
'- HTTPS = Port 443
'- IIS has a valid SSL certificate installed.
'- The Web site or virtual server that is used does not use HTTP/1.1 host headers for name resolution.

But it seems to me that this might still be insecure since the browser first makes a non-SSL connection to the server before it's redirected to make an SSL connection.

Am I correct?

When do the session variables actually get sent?
 
basically you have it about as secure as i can think of with the exception of whereever this link is coming from say an email to make sure it's https there before hand.

[thumbsup2]DreX
aKa - Robert
if all else fails, light it on fire and do the happy dance!
" I always think outside the 'box', because I'm never in the 'loop' " - DreX 2005
 
the last one being your most likely candidate, you're already doing the MS KB recommened.

[thumbsup2]DreX
aKa - Robert
if all else fails, light it on fire and do the happy dance!
" I always think outside the 'box', because I'm never in the 'loop' " - DreX 2005
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top