i have a aspx page see:
<%@ Page Language="C#" %>
<%
HttpContext.Current.Session["UserID"] = "ABC1";
Response.Write(HttpContext.Current.Session["UserID"].ToString());
%>
<script>
var parameters = { OpenURL: "test.pdf", java_arguments: "-Xmx256m" };
var attributes = {archive:"webviewerS.jar,jPDFViewerS.jar", code:"qoppa.webViewer.PDFWebViewer", width:"100%", Height:"95%"};
var version = "1.6.0";
deployJava.runApplet(attributes, parameters, version);
</script>
The page load and created a session variable, and i also added a custom httphandler to handle the http request of pdf, every user type the path with .pdf will run the class
response.Cookies["UserID"].HttpOnly = false;
if (HttpContext.Current.Session["UserID"] != null)
{
response.ContentType = "application/pdf";
response.WriteFile(request.PhysicalPath);
}
else
{
response.Write("access denied");
}
The main objective of this script to test is it possible to view the pdf only by using the java applet within that aspx page. But finally,
var parameters = { OpenURL: "test.pdf", java_arguments: "-Xmx256m" };
the java applet request to load the pdf, but it seems the session could not be detected at httphandler, but the above code is successful if i directly type the .pdf path after i loaded the .aspx page.
If the applet request the pdf file, the result of the seesion["UserID"] will be null, why it can't detect the session value?