xmlhttp question - friendly print page

Results 1 to 3 of 3

Thread: xmlhttp question - friendly print page

  1. #1
    Join Date
    Dec 1969

    Default xmlhttp question - friendly print page

    Hey guys I&#039;m trying to implement the friendly print page using the xmlhttp objectm ie request the page with the xmlhttp object, parse out the results.<BR><BR>All is well and good for pages that do not have session security built in. My security esentially works like this<BR><BR>If Sesion("userlevel")&#060;pageuserLevel Then Response.Redirect "default.asp"<BR><BR>So my question is does anyone know how or if it&#039;s pssible to set session variable information for the xmlhttp object, it seems that it&#039;s Session("userlevel") is blank ie doesn&#039;t use the actual users information. So my pages get redirected to the default.asp page.<BR><BR><BR><BR>

  2. #2
    Bill H. Guest

    Default I know this is silly but...

    you didn&#039;t cut and paste that out of your page did you? cuz session is spelled wrong...but I&#039;ve seen your answers on this forum and I know you&#039;re good at this stuff, so it&#039;s probably not that simple...

  3. #3
    Join Date
    Dec 1969

    Default Naw I'm just a bad speller

    I&#039;ve come up with a workaround that is ok. The problem is that when you request the page with the xmlhttp object you are not requesting it as that user so all the session vars are blank. Esentially the way I got around it is like this<BR><BR>in my security check include file ie where I do if session("userLevel")&#060;pageLevel etc I first do<BR><BR>If Request.Form("xmlHTTP") = "Some obscure text string" Then<BR> Session("UserLevel") = cInt(Request.Form("userLevel"))<BR> Session("dbID") = cLng(Request.Form("dbID"))<BR> Session("loginID") = Request.Form("loginID")<BR>End If<BR><BR>ie set the session values ffrom passed info from the xmlhttp object then on my page that uses the xmlhttp obj I do:<BR><BR>objXMLHTTP.Open "POST", refPage, False<BR> objXMLHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"<BR><BR> For each Item in Request.Querystring<BR> If Item&#060;&#062;"ref" Then<BR> If len(strSnd & "")&#062;0 Then<BR> strSnd = strSnd & "&" & Item & "=" & Request.QueryString(Item)<BR> Else <BR> strSnd = Item & "=" & Request.QueryString(Item)<BR> End If<BR> End If <BR> Next<BR>ie build strSnd from all values in querystring passed to printer friendly page, used when passing values to refpage.<BR><BR><BR> strSnd=strSnd & "&some obscure text string" & "&userLevel=" & Session("userLevel") & "&dbID=" & Session("dbID") & "&loginID=" & Session("loginID")<BR><BR>strSnd also has the other from values needed to process the refpage from above.<BR><BR>Anyways I basicall force impersonation of the user by the xmlhttp object<BR><BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts