Can't stay logged in after submitting form

Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default Can't stay logged in after submitting form

    I have several pages in a user only area. I can go from page to page to page
    until I submit a form (which goes to my email via formmail), then I have to log
    back in to get to another page.

    The code for the formmail page is:

    Any and all help to stay logged in is greatly appreciated.

    <%@LANGUAGE="VBSCRIPT"%>
    <!--#include file="Connections/Clients.asp" -->
    <%
    ' *** Restrict Access To Page: Grant or deny access to this page
    MM_authorizedUsers=""
    MM_authFailedURL="not_authorized.asp"
    MM_grantAccess=false
    If Session("MM_Username") <> "" Then
    If (true Or CStr(Session("MM_UserAuthorization"))="") Or _
    (InStr(1,MM_authorizedUsers,Session("MM_UserAuthor ization"))>=1) Then
    MM_grantAccess = true
    End If
    End If
    If Not MM_grantAccess Then
    MM_qsChar = "?"
    If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&"
    MM_referrer = Request.ServerVariables("URL")
    if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" &
    Request.QueryString()
    MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" &
    Server.URLEncode(MM_referrer)
    Response.Redirect(MM_authFailedURL)
    End If
    %>
    <%
    Dim Recordset1__MMColParam
    Recordset1__MMColParam = "1"
    If (Session("MM_username") <> "") Then
    Recordset1__MMColParam = Session("MM_username")
    End If
    %>
    <%
    Dim Recordset1
    Dim Recordset1_numRows

    Set Recordset1 = Server.CreateObject("ADODB.Recordset")
    Recordset1.ActiveConnection = MM_Clients_STRING
    Recordset1.Source = "SELECT * FROM clients WHERE username = '" +
    Replace(Recordset1__MMColParam, "'", "''") + "'"
    Recordset1.CursorType = 0
    Recordset1.CursorLocation = 2
    Recordset1.LockType = 1
    Recordset1.Open()

    Recordset1_numRows = 0
    %>
    <!--METADATA TYPE="typelib" UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
    NAME="CDO for Windows 2000 Library" -->
    <!--METADATA TYPE="typelib" UUID="00000205-0000-0010-8000-00AA006D2EA4"
    NAME="ADODB Type Library" -->
    <%
    Response.Buffer = true
    Session.Abandon()

    if Request.ServerVariables("REQUEST_METHOD") = "POST" then ' user is
    sending their application

    ' create the e-mail object and set the various fields
    Set objMessage = Server.CreateObject("CDO.Message")
    objMessage.To = "hiltonl@etsu.edu"
    objMessage.From = "Innovation Lab Website"
    objMessage.Sender = "hiltonl@etsu.edu"
    objMessage.Subject = "Service Request"
    BodyText = BodyText & "<p>A request for service</p>"
    BodyText = BodyText & "<table>"
    BodyText = BodyText & "<tr><td align=left>Name:</td><td>" &
    Recordset1.Fields.Item("full").Value& "</td></tr>"
    BodyText = BodyText & "<tr><td align=left>Company:</td><td>" &
    Recordset1.Fields.Item("company").Value& "</td></tr>"
    BodyText = BodyText & "<tr><td align=left>Email:</td><td>" &
    Recordset1.Fields.Item("email").Value& "</td></tr>"
    BodyText = BodyText & "<tr><td align=leftt>Type:</td><td>" &
    Request.Form("type") & "</td></tr>"
    BodyText = BodyText & "<tr><td align=left>Description:</td><td>" &
    Request.Form("description") & "</td></tr>"
    BodyText = BodyText & "</table>"
    objMessage.HTMLBody = BodyText

    ' specify mail server information
    set objConfig = Server.CreateObject("CDO.Configuration")
    objConfig.Fields(cdoSendUsingMethod) = 2
    objConfig.Fields(cdoSMTPServer) = "mail.etsu.edu"
    objConfig.Fields(cdoSMTPServerPort) = 25
    objConfig.Fields(cdoSMTPAuthenticate) = cdoAnonymous
    objConfig.Fields.Update
    set objMessage.Configuration = objConfig

    ' send the message and dispose of the object
    objMessage.Send()
    set objConfig = Nothing
    set objMessage = Nothing
    Server.Transfer ("request_thank_you.asp")
    'else visitor is going to view the application page
    Server.Transfer ("index.htm")
    end if
    %>
    <%
    Recordset1.Close()
    Set Recordset1 = Nothing
    %>

    innovationlab Guest

  2. Similar Questions and Discussions

    1. How to stay logged in
      Hello, I have created simple login sistem. I'm using sessions and they expire after I close my browser. How can I stay loged after I have closed...
    2. Submitting form
      Can i know whether any1 know hw to submit our form after validating to another form where we can get the input from the first page for .mxml?? And...
    3. Use PDf fill in form in Website and submitting form info.
      I feel like I'm 99% there, but I am missing something. I created the PDF form offline and tested submitting it. It works fine. When I upload and...
    4. Submitting Form Var Problem
      I have two dropdown list: frm_cbo_top frm_cbo_bottom I have an OnChange="submit_form();" in each of these dropdown lists - the javascript...
    5. stay on the submitting page
      Hi Maybee a little bit of topic, but is it possible to stay on the submitting page once you've clicked submit. This is to get processing done on...
  3. #2

    Default Re: Can't stay logged in after submitting form

    The problem is this line

    Session.Abandon()

    This is causing the all sessions to be dropped including MM_Username which
    is the one control access.

    --
    Regards

    Paul Whitham
    Macromedia Certified Professional for Dreamweaver MX2004
    Valleybiz Internet Design
    [url]www.valleybiz.net[/url]

    Team Macromedia Volunteer for Ultradev/Dreamweaver MX
    [url]www.macromedia.com/support/forums/team_macromedia[/url]

    "innovationlab" <webforumsuser@macromedia.com> wrote in message
    news:d40gt0$1fn$1@forums.macromedia.com...
    > I have several pages in a user only area. I can go from page to page to
    page
    > until I submit a form (which goes to my email via formmail), then I have
    to log
    > back in to get to another page.
    >
    > The code for the formmail page is:
    >
    > Any and all help to stay logged in is greatly appreciated.
    >
    > <%@LANGUAGE="VBSCRIPT"%>
    > <!--#include file="Connections/Clients.asp" -->
    > <%
    > ' *** Restrict Access To Page: Grant or deny access to this page
    > MM_authorizedUsers=""
    > MM_authFailedURL="not_authorized.asp"
    > MM_grantAccess=false
    > If Session("MM_Username") <> "" Then
    > If (true Or CStr(Session("MM_UserAuthorization"))="") Or _
    > (InStr(1,MM_authorizedUsers,Session("MM_UserAuthor ization"))>=1)
    Then
    > MM_grantAccess = true
    > End If
    > End If
    > If Not MM_grantAccess Then
    > MM_qsChar = "?"
    > If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&"
    > MM_referrer = Request.ServerVariables("URL")
    > if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer &
    "?" &
    > Request.QueryString()
    > MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" &
    > Server.URLEncode(MM_referrer)
    > Response.Redirect(MM_authFailedURL)
    > End If
    > %>
    > <%
    > Dim Recordset1__MMColParam
    > Recordset1__MMColParam = "1"
    > If (Session("MM_username") <> "") Then
    > Recordset1__MMColParam = Session("MM_username")
    > End If
    > %>
    > <%
    > Dim Recordset1
    > Dim Recordset1_numRows
    >
    > Set Recordset1 = Server.CreateObject("ADODB.Recordset")
    > Recordset1.ActiveConnection = MM_Clients_STRING
    > Recordset1.Source = "SELECT * FROM clients WHERE username = '" +
    > Replace(Recordset1__MMColParam, "'", "''") + "'"
    > Recordset1.CursorType = 0
    > Recordset1.CursorLocation = 2
    > Recordset1.LockType = 1
    > Recordset1.Open()
    >
    > Recordset1_numRows = 0
    > %>
    > <!--METADATA TYPE="typelib" UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
    > NAME="CDO for Windows 2000 Library" -->
    > <!--METADATA TYPE="typelib" UUID="00000205-0000-0010-8000-00AA006D2EA4"
    > NAME="ADODB Type Library" -->
    > <%
    > Response.Buffer = true
    > Session.Abandon()
    >
    > if Request.ServerVariables("REQUEST_METHOD") = "POST" then ' user is
    > sending their application
    >
    > ' create the e-mail object and set the various fields
    > Set objMessage = Server.CreateObject("CDO.Message")
    > objMessage.To = "hiltonl@etsu.edu"
    > objMessage.From = "Innovation Lab Website"
    > objMessage.Sender = "hiltonl@etsu.edu"
    > objMessage.Subject = "Service Request"
    > BodyText = BodyText & "<p>A request for service</p>"
    > BodyText = BodyText & "<table>"
    > BodyText = BodyText & "<tr><td align=left>Name:</td><td>" &
    > Recordset1.Fields.Item("full").Value& "</td></tr>"
    > BodyText = BodyText & "<tr><td align=left>Company:</td><td>" &
    > Recordset1.Fields.Item("company").Value& "</td></tr>"
    > BodyText = BodyText & "<tr><td align=left>Email:</td><td>" &
    > Recordset1.Fields.Item("email").Value& "</td></tr>"
    > BodyText = BodyText & "<tr><td align=leftt>Type:</td><td>" &
    > Request.Form("type") & "</td></tr>"
    > BodyText = BodyText & "<tr><td align=left>Description:</td><td>" &
    > Request.Form("description") & "</td></tr>"
    > BodyText = BodyText & "</table>"
    > objMessage.HTMLBody = BodyText
    >
    > ' specify mail server information
    > set objConfig = Server.CreateObject("CDO.Configuration")
    > objConfig.Fields(cdoSendUsingMethod) = 2
    > objConfig.Fields(cdoSMTPServer) = "mail.etsu.edu"
    > objConfig.Fields(cdoSMTPServerPort) = 25
    > objConfig.Fields(cdoSMTPAuthenticate) = cdoAnonymous
    > objConfig.Fields.Update
    > set objMessage.Configuration = objConfig
    >
    > ' send the message and dispose of the object
    > objMessage.Send()
    > set objConfig = Nothing
    > set objMessage = Nothing
    > Server.Transfer ("request_thank_you.asp")
    > 'else visitor is going to view the application page
    > Server.Transfer ("index.htm")
    > end if
    > %>
    > <%
    > Recordset1.Close()
    > Set Recordset1 = Nothing
    > %>
    >

    Paul Whitham TMM Guest

  4. #3

    Default Re: Can't stay logged in after submitting form

    Just got around to trying that and it was the ticket.

    God Bless you! I always get a 'fix' here!
    innovationlab Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139