Laravel doesn't keep session when use SQLite database
I converted my MySQL database to SQLite one, but now the login system is not working anymore. I'm using DATABASE=sqlite
and SESSION_DRIVER=file
. What's wrong?
When I type my email and password and press Login, the system redirects me at Login page again without any error messages.
I tried to change the redirect route after login many times, and only that are unauthenticated routes are working; This is because Auth::user or auth()->user()
are Undefined objects. The login is going well, because if I make a typo in password the system tells me that credentials are wrong.
Obviously, I tried to do querys when SQLite database is set and are working well (AppUser::first()->name in login.blade.php
, for example).
I tried to revert DB_CONNECTION=mysql
and all works as expected (as before too): when I login with my email and password the system redirects me to the dashboard.
I'm using Laravel 5.7 in Windows 10 with SQLite 3.26.
EDIT
Part of my .env file
APP_NAME=*****
APP_ENV=local
APP_KEY=******
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost
DB_CONNECTION=sqlite
DB_DATABASE=database.sqlite
BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
SESSION_LIFETIME=120
QUEUE_DRIVER=sync
...
SNAPPY_PDF_BIN='C://"Program Files"/wkhtmltopdf/bin/wkhtmltopdf'
SNAPPY_IMG_BIN='C://"Program Files"/wkhtmltopdf/bin/wkhtmltoimage'
SES_KEY=****
SES_SECRET=****
mysql laravel sqlite
add a comment |
I converted my MySQL database to SQLite one, but now the login system is not working anymore. I'm using DATABASE=sqlite
and SESSION_DRIVER=file
. What's wrong?
When I type my email and password and press Login, the system redirects me at Login page again without any error messages.
I tried to change the redirect route after login many times, and only that are unauthenticated routes are working; This is because Auth::user or auth()->user()
are Undefined objects. The login is going well, because if I make a typo in password the system tells me that credentials are wrong.
Obviously, I tried to do querys when SQLite database is set and are working well (AppUser::first()->name in login.blade.php
, for example).
I tried to revert DB_CONNECTION=mysql
and all works as expected (as before too): when I login with my email and password the system redirects me to the dashboard.
I'm using Laravel 5.7 in Windows 10 with SQLite 3.26.
EDIT
Part of my .env file
APP_NAME=*****
APP_ENV=local
APP_KEY=******
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost
DB_CONNECTION=sqlite
DB_DATABASE=database.sqlite
BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
SESSION_LIFETIME=120
QUEUE_DRIVER=sync
...
SNAPPY_PDF_BIN='C://"Program Files"/wkhtmltopdf/bin/wkhtmltopdf'
SNAPPY_IMG_BIN='C://"Program Files"/wkhtmltopdf/bin/wkhtmltoimage'
SES_KEY=****
SES_SECRET=****
mysql laravel sqlite
Could you post your env file? These should be unrelated.
– Leonardo Leite
Dec 28 '18 at 17:59
@LeonardoLeite I edited the post adding my .env
– sevenlops
Jan 7 at 16:06
add a comment |
I converted my MySQL database to SQLite one, but now the login system is not working anymore. I'm using DATABASE=sqlite
and SESSION_DRIVER=file
. What's wrong?
When I type my email and password and press Login, the system redirects me at Login page again without any error messages.
I tried to change the redirect route after login many times, and only that are unauthenticated routes are working; This is because Auth::user or auth()->user()
are Undefined objects. The login is going well, because if I make a typo in password the system tells me that credentials are wrong.
Obviously, I tried to do querys when SQLite database is set and are working well (AppUser::first()->name in login.blade.php
, for example).
I tried to revert DB_CONNECTION=mysql
and all works as expected (as before too): when I login with my email and password the system redirects me to the dashboard.
I'm using Laravel 5.7 in Windows 10 with SQLite 3.26.
EDIT
Part of my .env file
APP_NAME=*****
APP_ENV=local
APP_KEY=******
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost
DB_CONNECTION=sqlite
DB_DATABASE=database.sqlite
BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
SESSION_LIFETIME=120
QUEUE_DRIVER=sync
...
SNAPPY_PDF_BIN='C://"Program Files"/wkhtmltopdf/bin/wkhtmltopdf'
SNAPPY_IMG_BIN='C://"Program Files"/wkhtmltopdf/bin/wkhtmltoimage'
SES_KEY=****
SES_SECRET=****
mysql laravel sqlite
I converted my MySQL database to SQLite one, but now the login system is not working anymore. I'm using DATABASE=sqlite
and SESSION_DRIVER=file
. What's wrong?
When I type my email and password and press Login, the system redirects me at Login page again without any error messages.
I tried to change the redirect route after login many times, and only that are unauthenticated routes are working; This is because Auth::user or auth()->user()
are Undefined objects. The login is going well, because if I make a typo in password the system tells me that credentials are wrong.
Obviously, I tried to do querys when SQLite database is set and are working well (AppUser::first()->name in login.blade.php
, for example).
I tried to revert DB_CONNECTION=mysql
and all works as expected (as before too): when I login with my email and password the system redirects me to the dashboard.
I'm using Laravel 5.7 in Windows 10 with SQLite 3.26.
EDIT
Part of my .env file
APP_NAME=*****
APP_ENV=local
APP_KEY=******
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost
DB_CONNECTION=sqlite
DB_DATABASE=database.sqlite
BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
SESSION_LIFETIME=120
QUEUE_DRIVER=sync
...
SNAPPY_PDF_BIN='C://"Program Files"/wkhtmltopdf/bin/wkhtmltopdf'
SNAPPY_IMG_BIN='C://"Program Files"/wkhtmltopdf/bin/wkhtmltoimage'
SES_KEY=****
SES_SECRET=****
mysql laravel sqlite
mysql laravel sqlite
edited Jan 7 at 16:05
sevenlops
asked Dec 28 '18 at 12:59
sevenlopssevenlops
185
185
Could you post your env file? These should be unrelated.
– Leonardo Leite
Dec 28 '18 at 17:59
@LeonardoLeite I edited the post adding my .env
– sevenlops
Jan 7 at 16:06
add a comment |
Could you post your env file? These should be unrelated.
– Leonardo Leite
Dec 28 '18 at 17:59
@LeonardoLeite I edited the post adding my .env
– sevenlops
Jan 7 at 16:06
Could you post your env file? These should be unrelated.
– Leonardo Leite
Dec 28 '18 at 17:59
Could you post your env file? These should be unrelated.
– Leonardo Leite
Dec 28 '18 at 17:59
@LeonardoLeite I edited the post adding my .env
– sevenlops
Jan 7 at 16:06
@LeonardoLeite I edited the post adding my .env
– sevenlops
Jan 7 at 16:06
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53958991%2flaravel-doesnt-keep-session-when-use-sqlite-database%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53958991%2flaravel-doesnt-keep-session-when-use-sqlite-database%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Could you post your env file? These should be unrelated.
– Leonardo Leite
Dec 28 '18 at 17:59
@LeonardoLeite I edited the post adding my .env
– sevenlops
Jan 7 at 16:06