Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Log-in page that brings you back to where you were

New Here ,
Mar 02, 2010 Mar 02, 2010

Hi,

I am trying to have a log in page where it brings you back to the page you were on after you log in. In the Log In User window under Server Behaviors, there is a check box that says Go To Previous URL (if it exists). I tried checking that, but it wouldn't let me leave without putting in something in the form above it. Does anyone know what I put there or how to circumvent this issue?

screenshot.jpg

TOPICS
Server side applications
835
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Mar 03, 2010 Mar 03, 2010

Navigate to one of the pages that requires authentication. The authentication script should detect that you are not logged in and redirect you to the login page. Now look at the url and see if the origina page url is embedded in there. Or, just copy and paste the url in the address bar to the forum so we can see.

Translate
LEGEND ,
Mar 02, 2010 Mar 02, 2010

Put the url where you want the user to go if they were not previously on one of your pages. For example, if the user enters your login page directly then there was not previous url so they need to go somewhere. Use your homepage or anything else that makes sense.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 03, 2010 Mar 03, 2010

I tried that, but then it always goes back to homepage no matter where I came from. Here is a screenshot of my Log In User screen:

Screenshot.jpg

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 03, 2010 Mar 03, 2010

Screenshot.jpg

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 03, 2010 Mar 03, 2010

In order for it to work, the authentication behavior needs to pass the page you were on to the login script page. So the first thing to check is to see if the page you want to be redirected back to is embedded in the query string when you are directed to the login page.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 03, 2010 Mar 03, 2010

Sorry... I'm pretty new at this. How do I check that and what am I looking for?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 03, 2010 Mar 03, 2010

Navigate to one of the pages that requires authentication. The authentication script should detect that you are not logged in and redirect you to the login page. Now look at the url and see if the origina page url is embedded in there. Or, just copy and paste the url in the address bar to the forum so we can see.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 04, 2010 Mar 04, 2010

Thank you! That worked

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 17, 2011 Aug 17, 2011
LATEST

what did you fix to make this work? having same problem.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 17, 2011 Aug 17, 2011

I am having a similar issue. I am using the following:

  • Dreamweaver CS5
  • MYSQL
  • phpadmin
  • IIS6.0 websever

I am trying to create a login page that when the user tries to access a restricted page, it doesn't go back to the previous URL when the check box is selected. When I create a LOGIN folder in the root of the website, and create the login.php file I get a PAGE can't be found and for some reason there is an extra login folder in the path on the error screen. ie.. http://www.example.com/login/login/login.php  (note extra login folder, should only be one login folder in path)

if I just put the login.php file in the root of the website, even if I enter in the correct creditials, I still get routed back to the login.php page on error.

see screen shot below of extra login folder added to URL   (click on image to enlarge)

Untitled-1.gif

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines