Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Response.AddHeader

Posted on 2001-08-19
8
Medium Priority
?
387 Views
Last Modified: 2012-06-21
The Response object supports AddHeader which is suppose to add a custom header to the page that is being sent to the client.

To read that header in the Request Object you just read it as a server variable with the HTTP prefix.
 
What I am trying to do is to be able to set a guid as a header then read it whenever the page makes another call to the server. This is to avoid the use of the IIS sessions without having to append a guid as part of the form being submitted or querystring for all links on every page.
 
So the design would be:
 
A person requests a page.
As the page is being created a custom header is added (Response.AddHeader("GUID",strSessionGUID)
The person views the page then clicks on a link or submits a form.
The request is processed and I grab the custom header (Request.ServerVariables("HTTP_GUID")) to find out what their session guid.

Can this be done? Most of my research points to no, but that is why I turn to all of you. If not, what is another way to pass a guid to the client and back to the server without using cookies and without having to add the information to every link and form submission?

Thanks,

Kent
0
Comment
Question by:kfehriba
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 28

Expert Comment

by:AzraSound
ID: 6404288
The ServerVariables collection of the Request object contains only those headers sent from the client to the server, and since the header created via the AddHeader method is done at the server, it is lost, unless it is also defined at the client, when you attempt to request it on your next page.  Its just not part of the ServerVariables collection.
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 6404476
>>what is another way to pass a guid to the client and back to the server

There are really only 3 ways, and commercial products that emulate the Session object all use one of these:

1) Cookies/Built-in Session Object
2) Append GUID to every URL
3) Write GUID to hidden input element on every page


Even the Cookie Munger from MS resorted to appending the GUID to the URL.  Of course, I'd be more than happy to be proven wrong...
0
 
LVL 5

Expert Comment

by:raizon
ID: 6404537
I agree with AzraSound.  You will find that most Companies/Sites append the GUID to the URL.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 1

Author Comment

by:kfehriba
ID: 6406072
Azra,

You state, "since the header created via the AddHeader method is done at the server, it is lost". But it isn't 'lost' at the server is it? I thought that it is sent to the client. And the client does have the capability of returining headers to the server? Is this just a problem that the server does not know how to read those headers or does the client not return those headers?

Kent
0
 
LVL 28

Accepted Solution

by:
AzraSound earned 400 total points
ID: 6406359
>>Is this just a problem that the server does not know how to read those headers or does the client not return those headers?

Its because the client does not return those headers.  You can send a custom header to the client, which, if programmed to do so, will respond to that header.  But the client then sends back headers to the server that it is programmed to do so, which the header you created at the server is not one of.
0
 
LVL 1

Author Comment

by:kfehriba
ID: 6406407
Can the client view the custom headers using java script, if so, what is the code?

Kent
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 6406568
To be honest, I have no idea.  Perhaps you can post a question asking this in the Javascript topic area.
0
 
LVL 1

Author Comment

by:kfehriba
ID: 6406592
Thanks for the input.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question