473,415 Members | 1,562 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,415 software developers and data experts.

Writing/Reading Custom Headers

Tell me if this can be done, and if I have a misconception here.

I am writing an app that will be served up in an app farm, and
therefore I need to move the session information to the client, not
using server-side session features. The way I have typically done this
in the ASP world was with cookies. Another way to handle this is with
a keyed record in a database, but the cookie strategy reduces the
number of times I need to hit a database, and allows me to scale the
application better by not using a database table to store session
information.

However, I recently heard from a developer that, to get around the
restrictions on cookies, their product switched to reading and writing
custom headers. (The product, by the way, was Plumtree Corporate
Portal.) Specifically the restrictions on cookies are from the
goofball folks who install cookie security products or turn these off.
(Gee, switching to the latest Mozilla always saved me the trouble of
messing with cookie security holes.)

So, I decided to start reading and writing custom headers. I want to,
for instance, store a custom header, send a location header to
redirect to another page, and then read that custom header back.
(Imagine a login scenario where I verify login and then want to store
a user's full name in a header, then redirect them to the main menu
page.)

I guess that would mean:

$varlabel = 'FULLNAME';
$varvalue = 'Google Mike';
Header('TRACK_' . $varlabel . ': ' . $varvalue);
Header('Location: mainmenu.php'); //does a redirect
Exit;

But then on mainmenu.php, when I try to read all the headers back
with...

$headers = getallheaders();
while (list($key, $val) = each($headers)) {
echo "$key => $val<BR>\n";
}

....I don't see any of the TRACK_* headers I was storing. What's the
catch?
Jul 17 '05 #1
1 3911
Dang it. Looks like this article posted through Google Groups, after
all. Sorry to have posted this twice.

To be more brief, I was wondering why, when you use the header()
function to write a custom header, then redirect to another page with
header("Location: test2.php"), the getallheaders() array doesn't
return back the custom header that I wrote, but returns other browser
headers.

If you have an answer, I'd really like to know.
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Google Mike | last post by:
Gosh. I posted this earlier on Google Groups, but it didn't appear. Perhaps there was a problem at Google. Forgive me for posting it again. This time, I'll be more brief. Instead of using...
385
by: Xah Lee | last post by:
Jargons of Info Tech industry (A Love of Jargons) Xah Lee, 2002 Feb People in the computing field like to spur the use of spurious jargons. The less educated they are, the more they like...
10
by: Jason Curl | last post by:
Dear C group, I'm very interested in writing portable C, but I only have GNU, Sparc and Cygwin to compile on. What I find is the biggest problem to writing portable C is what headers to...
6
by: _jpg_ | last post by:
Hi, I need to read (& store) all the custom response headers in an HttpResponse. I am writing an HttpModule and hence do not know what headers could have been added (but need to cache them for...
5
by: Shelly | last post by:
hi, I am trying to create a custom HTTP header and trying to access that variable on another ASP.NET webpage. Following is the code base- I use the following code to set the header...
3
by: Jacky | last post by:
hi, I am trying to view the custom headers in an ASP.NET page. I am able to view all the standard headers using the method Request.Headers.Get(). But if i set a custom header using...
2
by: AMDRIT | last post by:
Hello everyone, I have created a custom component and one of its properties is a class object with it's own properties. During runtime, I can assign values to the class object properties just...
1
by: asnowfall | last post by:
I am creating MailMessage out of already existing email message. My existing message has few custom properties. I wan to add them to System.Net.Mail.MailMessage How to add custom properties? ...
0
by: Dean Hallman | last post by:
Hello, I am developing a BHO that should add a custom HTTP header on a specific domain only. Don't want the header globally, otherwise I could just add a registry key. So, on...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.