Converting GET URL to a POSTed one while maintaining session

K

Keith Patrick

I've got an app that does a ton of Response.Redirect's to bring up various
pages. Due to some printer-friendly stuff we use, the URLs all have to pass
their data in via the querystring. However, we're hitting problems where
the URL becomes too long, so now I'm trying to convert all the
querystring-based URLs to simple ones where the key/value pairs are placed
in the header rather than in the URL. I have it working via
WebClient.UploadValues, and I had an attempt via streaming data manually
to/from HttpWebRequests/Responses, but the issue I run into every time is
that my resulting page is the login page, since the new calls fail forms
authentication. Is there some way to transfer the session/authentication
data to the client or response/request, or should I find a new means for
converting to POST?
 
J

Joerg Jooss

Keith said:
I've got an app that does a ton of Response.Redirect's to bring up
various pages. Due to some printer-friendly stuff we use, the URLs
all have to pass their data in via the querystring. However, we're
hitting problems where the URL becomes too long, so now I'm trying to
convert all the querystring-based URLs to simple ones where the
key/value pairs are placed in the header rather than in the URL.

Only cookies carry data in HTTP headers... or do you make up your own
header?
I have it working via WebClient.UploadValues, and I had an attempt via
streaming data manually to/from HttpWebRequests/Responses, but the
issue I run into every time is that my resulting page is the login
page, since the new calls fail forms authentication. Is there some
way to transfer the session/authentication data to the client or
response/request, or should I find a new means for converting to
POST?

You need to manage your web application's session cookie. See
System.Net.CookieContainer for client-side cookie management.

Cheers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top