Rank: Member Groups: Member
Joined: 4/20/2011 Posts: 19
|
Ok I have a html generated report, and at the top of the html page is an image. The problem ive run into is the report page uses session variables to ensure the user logged in can access the report, and used to pull the specific case/report. However if I use the url convert it acts as if there are no session variables, or the control that converts the url cannot access session variables. The second method I tried was converting the html code directly instead of using a web page, but now the banner image does not show on the report. Is there a way for the url converter to use session variables? Maybe im not setting it up correctly?
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
Our converter does not rely on your browser, it does not share your browser session either --- it short, it does not have anything to do with your browser or state data managed by your browser. So whatever session variable that was set in "your" session will not be visible in the converter's session.
You could rebuild the converter's session by following the exact path that of an end user --- for example, if you set a session variable after user has logged into through a login page, you can call ConvertUrl on the login page with the correct user name and password to establish that session variable in the converter's session. However in reality that is often not practical for many reasons: you are converting many pages before your final page; if you change your code logic you would have to change the converting code as well, etc.
The easiest solution for such scenario is to change your code to recognize additional query string parameter and then passes those parameters in through query string when you run the converter. For example, if your Report.aspx relies on a "ReportID" session variable to determine which report it should run, you can change it to also take an "ReportID" query string argument so that you can pass something to "Report.aspx?ReportID=xxxx". Basically you would just change wherever you check for session variable to also check for query string argument.
Two additional things to keep in mind when you do this: 1. Security. User maybe able to pass in arguments that are not accessible through session variables (for example, user will only be able to set “ReportID” session variable to 1, 2, 3, but if you use query string, they can also pass in 4). So make sure you have additional security measure to prevent unauthorized access; 2. Encoding. query string are strings; session variable can store objects. So you may need to encode/decode your session variable values accordingly;
Hope this helps. Please feel free to let us know if you still have any questions.
Thanks!
|