473,381 Members | 1,435 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,381 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

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

I guess that would mean:

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

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

$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
Jul 17 '05 #1
1 3908
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

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

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...
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...
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...
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...
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...
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...
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...
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? ...
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...
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
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...

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.