Forum Moderators: open
Here is my problem, we are moving to SSL, and I want to write a redirect in my global.asa to take anyone who comes in using http and move them to https. The problem is that some of my customers have forms on their intranets that pass to me login data, so that their employees don't have to login to my site after already having logged into their own. So, to give all of my customers time to update their form actions, I'd like to perform the redirect and pass along the data. I tried using server.transfer, but it won't let me transfer to an absolute url (including the https), so I have to user response.redirect... I can capture the form data, I just don't know how to put it back in the form collection for the redirect. any help would be appreciated.
-Moz
You could store the stuff in the form variable into Session variables, then do the Response.Redirect, then pull them back out after the redirect.
You could store the stuff in the form variable into Session variables, then do the Response.Redirect, then pull them back out after the redirect.
This is the best way to do it, but if for some reason you can't do a session (if the user has cookies blocked, for example, you won't be able to set/retrieve session variables) there is another method: Encrypt the information using Base64 or some other simple encryption and response.redirect with the data in the querystring. Something like this in your redirect page should do the trick:
FOR EACH parameter IN request.form
qsdata = qsdata & parameter & "=" & request.form(parameter) & "&"
NEXTIf Right(qsData,1) = "&" Then
qsData = Left(qsData,len(qsData) -1)
End If
response.redirect "http://www.domain.com/newpage.asp?" & qsData
That would do the trick without encryption. If you want to encrypt, make a function to do your encryption and use EncryptFunction(request.form(parameter)) while looping.
Again, the session variable is the best way to go - just giving you another option if it's not available :)