search
  • Sign In
  • Sign Up
Password reset successful

Follow the proiects vou are interested in andi aet the latestnews about them taster

3 answers
Q&A php - Jump to the page before login after logging in

0

laravel5.4 How do I return to the page before logging in after logging in? How do I maintain this state?
Please ask God for answers

Your Answer
submit

3 answers
0

I don’t understand

laravel. Let’s talk about the idea of ​​​​implementing this function without the framework under normal circumstances

You can get the current url when jumping to the landing page. When jumping to the landing page, splice it into a get parameter of the landing page, as shown below:

Then when submitting the login information, determine whether the url parameter has a value, and then jump to the page before login

2017-07-06 10:36:32

submit

0

You can follow the following steps to troubleshoot:

  1. Check whether the cookie in the logged in post request carries session information;

  2. The AuthController that handles login requests has a field redirectPath, which represents the jump page after successful login. Check whether this value is correct;

2017-07-06 10:36:32

submit

0
<?php

namespace App\Http\Controllers;

use Illuminate\Support\Facades\Auth;

class LoginController extends Controller
{
    /**
     * Handle an authentication attempt.
     *
     * @return Response
     */
    public function authenticate()
    {
        if (Auth::attempt(['email' => $email, 'password' => $password])) {
            return redirect()->intended('dashboard');  // 关键此处的intended
        }
    }
}
2017-07-06 10:36:32

submit

Popular tool

vc9-vc14 (32+64 bit) runtime library collection (link below)

vc9-vc14 (32+64 bit) runtime library collection (link below)

Download the collection of runtime libraries required for phpStudy installation

VC9 32-bit

VC9 32-bit

VC9 32-bit phpstudy integrated installation environment runtime library

PHP programmer toolbox full version

PHP programmer toolbox full version

Programmer Toolbox v1.0 PHP Integrated Environment

VC11 32-bit

VC11 32-bit

VC11 32-bit phpstudy integrated installation environment runtime library

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use