Urgent - Login/Authentication code problem

Results 1 to 2 of 2

Thread: Urgent - Login/Authentication code problem

  1. #1
    Join Date
    Dec 1969

    Default Urgent - Login/Authentication code problem

    The problem is that I have set up a web with login code & it works on some but not all of the web pages. It will not execute on my default page that is in frames. I have tried putting the code on the container page(default) and also the frames - store.asp and form.htm. My code for the login has 4 components<BR><BR>1. The form - which is your basic code<BR>2. The login.asp<BR><BR>&#060;%<BR> Response.Buffer = True<BR> Dim Cm, RS<BR><BR><BR> Set Cm = Server.CreateObject("ADODB.Command")<BR><BR> Cm.ActiveConnection = "DSN=cogcdsn"<BR><BR><BR> Cm.CommandText = "SELECT * FROM Admin WHERE " &_<BR> "Username=&#039" & Request.Form("Username") & "&#039 AND " &_<BR> "Password=&#039" &_<BR> Request.Form("UserPassword") & "&#039"<BR><BR> Cm.CommandType = 1<BR><BR> Set RS = Cm.Execute<BR><BR> If RS.EOF Then<BR> Session("Authenticated") = 0<BR> Response.Redirect ("Login.htm")<BR><BR> Else<BR><BR> Session("Authenticated") = 1<BR> Response.Redirect ("default.htm")<BR><BR> End If<BR>%&#062;<BR><BR>3. The code I put on the top of every page in the web:<BR><BR> &#060;%<BR> If Session("Authenticated") = 0 Then<BR> response.redirect("login.htm")<BR> End if<BR> %&#062;<BR><BR>4. And finally my global.asa<BR><BR>&#060;SCRIPT LANGUAGE=VBScript RUNAT=Server&#062;<BR> <BR> Sub Session_OnStart<BR> <BR> <BR> Set Cart = Server.CreateObject ("iiscart2000.store")<BR> Cart.ConnectString = "cogc"<BR> Cart.StateTaxRate = "7%"<BR> Cart.CountryTaxRate = "7%"<BR> Session("Cart") = Cart.SaveCart<BR> Set Cart = Nothing<BR> Session("Authenticated") = 0<BR> end sub<BR> <BR> Sub Session_OnEnd<BR> <BR> Set Session("Cart") = Nothing<BR> <BR> end sub<BR> <BR> &#060;/SCRIPT&#062;<BR> <BR>Can someone please take a look<BR>Thanks<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Urgent - Login/Authentication code problem

    Possibly its because, sometimes you get the page from Cache but not from server. After you login, if you visit a page which is protected and if it is displayed from cache then, it doesn&#039t know that you have logged in. Try with, go to server for every visit option.<BR><BR>if you dont know where it is...<BR><BR>In your browser go to Internet Options<BR>under General tab, Temporary internet files and settings<BR>select every visit to the page.<BR><BR>I am very new to ASP and I am just guessing.<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