Login Issue

Posted on 2005-05-16
Last Modified: 2010-04-25
I have a few secure pages developed using Dreamweaver and ASP vbscript.

At the moment when a user tries to access a restricted page with logging it takes them to the login page. When the user logs in they have to find the page they wanted all over again.

Is there a way so that when a user tries to access a restricted page, it will ask them to login and then redirect them to the page they were originally trying to get into in the first place

Any help would be great


Question by:patelajk
    LVL 8

    Expert Comment

    You could do this in a couple of ways...

    Using javascript you could use history.go(-1) or history.go(-2), depending on the number of pages back you want to go.  When the page loads again it will check to see if the user is logged in and grant them access.


    You could track the page(s) in a session object.  This would allow you to keep resident the page that the user was trying to access before they logged in.  Once they've logged in to the system then you could do a simple redirect based on the session object.
    LVL 9

    Accepted Solution

    You can use the ASP code..

    If IsEmpty(Request.Form("Referrer")) Then
          Referrer = "default starting page"
          Referrer = Request.Form("Referrer")
    End If

    and somewhere...

    if Session("LoggedIn")=true then
            Response.Redirect Referrer
    end if

    We are using this code - I did not originally write it - but it works... somehow...

    with a smile

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
    Adobe Dreamweaver CS5 is a WYSIWYG web page editor that has advanced HTML, CSS, and Javascript rendering functionality and is probably the most well-known HTML editor available. Much of Dreamweaver's appeal centers around the Design View interfac…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now