Not able to redirect when asp page
Manish Singh
maneeshsingh1986 at gmail.com
Sun Nov 18 17:31:48 EST 2012
Hi,
I am using sendRedirect to redirect to target url.
Redirection works perfectly for html page but when I try to redirect to asp
page it don't works.
html page: https://wasspwin-test.testorg.biz/hello_world.html
Asp page:https://wasspwin-test.testorg.biz/all.asp
long sendRedirect(const char* url) {
HTTPResponse::sendRedirect(url);
string hdr=string("Location: ") + url + "\r\n"
"Expires: Wed, 01 Jan 1997 12:00:00 GMT\r\n"
"Cache-Control: max-age=0\r\n";
for (multimap<string,string>::const_iterator i = m_headers.begin();
i != m_headers.end(); ++i)
hdr += i->first + ": " + i->second + "\r\n";
hdr += "\r\n";
m_pfc->ServerSupportFunction(m_pfc, SF_REQ_SEND_RESPONSE_HEADER,
"302 Please Wait", (ULONG_PTR)hdr.c_str(), 0);
static const char*
redmsg="<HTML><BODY>Redirecting...</BODY></HTML>";
DWORD resplen=strlen(redmsg);
m_pfc->WriteClient(m_pfc, (LPVOID)redmsg, &resplen, 0);
return SF_STATUS_REQ_FINISHED;
}
----------------------------------------------------------------------------------------
also stf.setcookie do not work. so I used pfc->AddResponseHeaders(pfc,
const_cast<char*>(str.c_str()), 0);
if ( !bCookieExists )
{
res = stf.getServiceProvider().doExport(stf);
//Create WSL cookie
string str = "Set-Cookie: WSL-external=";
str += cookiehandler.CreateWSLCookie(&stf);
str += "; path=/;\r\n";
pfc->AddResponseHeaders(pfc, const_cast<char*>(str.c_str()), 0);
stf.sendRedirect(stf.getRequestURL());
if (res.first) return res.second;
//END
}
--
Thanks & Regards,
Maneesh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://shibboleth.net/pipermail/dev/attachments/20121118/588113bd/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ---all.asp--
Type: application/octet-stream
Size: 599 bytes
Desc: not available
Url : http://shibboleth.net/pipermail/dev/attachments/20121118/588113bd/attachment.obj
More information about the dev
mailing list