3

Render Login without redirect

If I have shotgun 3 tabs open and I close my web browser for the night when I go home for the weekend. When I open the browser on Monday All 3 tabs have the login prompt. If I want to get back to where I was last night I have to log in to one of the tabs and hit the back button on the other tabs. This also is prone to break if I opened a new tab and dont have any back history I have to close the tab because the back button takes me to the login page.

There is a better way for dynamic web sites.

When a user is not authenticated instead of redirecting them to the login page, render the login page for the current url. When the user logs in, redirect them to the current page. You should make sure to clear your form data so they don't get a form re-submission warning(handled by the redirect) if they try to reload the page. The user then simply has to refresh the other tabs that currently show log in prompts to get back to where they were at previously. And there is no chance for the redirect to get broken by missing data.

0 comments

Please sign in to leave a comment.