login - Go back to last webpage after logging in -


i need figuring out how allow users login go page on before being sent login page. here quote boss:

sometimes forget sign in , go page, click , notice joining or signing in. fine, there way, once sign in open page trying open prior signing in, instead of having go through navigation again?

i'm using php project.

whatever mechanism forwards user sign-in page should include original page's url parameter. like:

header('location: http://example.com/login.php?redirectto=' + urlencode($_server['request_uri'])); 

then login.php page can redirect page after user authenticates:

header('location: ' . $_get['redirectto']); 

you may want put in checking on redirectto value in login.php make sure nobody's trying malicious, suppose. though can't think of malicious do. (though would want include default if no url provided.)

but general idea authentication mechanism provides login page redirect url when detects user needs login.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -