Questions tagged [sessions]
Use it for questions about the session system, which handles recognizing users from a session cookie.
237 questions
0 votes
0 answers
44 views
Sharing the user sessions table (table from another database)
I need to share sessions table between 2 sites (same domain, eg. .mysite.com). In drupal 7, i have already build this in settings.php. I have created a new database for this. On drupal 10/11, this ...
1 vote
1 answer
79 views
How to access PDF of a draft Webform submission for an anonymous user with a new session?
I have a Webform setup with a secure token URL, allowing anonymous users to edit and submit draft submissions, like this: https://website.com/webform/test_save?token=...
1 vote
1 answer
350 views
Using a session for anonymous users
I set some session data for a user I auto logged out. Then tried to retrieve that session data in a form validation. It is not there. class MFAController extends ControllerBase { public function ...
0 votes
0 answers
60 views
I cant get the session
I m beginner on drupal, and i have a problem with session. I created a custom form submission inside the clubs module. namespace Drupal\idan_login\Form; // Form submission handler. public function ...
3 votes
1 answer
129 views
Drupal unable to login and logout several accounts in a single functional test
I am trying to run some functional tests in DDEV that check functions of protected routes. I can log in the first couple of users fine, but after that drupaLogin() fails to generate a logged in ...
0 votes
0 answers
107 views
TFA Session expired when user login
not sure if anyone faces this issue, when I tried to login with the authentication. It shows TFA session has expired. But the user account was logged in. Screenshot attached, I tried to drupal set ...
0 votes
0 answers
253 views
Messenger doesn't display value after user logged out and redirect
After my user is submitting a form, I want to logged him out, then redirect to the front page. then, display a message. public function submitForm(array &$form, FormStateInterface $form_state) { ...
2 votes
1 answer
579 views
Persistent anonymous user session with headless D9
In short: a new php session is started upon every request made through nextjs, I somehow must keep the anonymous user session alive. For my anonymous users I need keep track of data submitted through ...
0 votes
0 answers
105 views
Login fails: returns to anonymous user home page with no message
I am testing upgrade to Drupal 9. I upgraded core and logged in and fixed a few issues with module deprecated code and then was presented with a Twig issue where replace syntax had changed. I changed ...
0 votes
1 answer
858 views
Site stuck in 'headers have already been sent' login loop after D9 upgrade
Suggestions for debugging a site which is now stuck in a "headers have already been sent" loop after successful login (redirect back to login form)? This is a production server for a site ...
3 votes
1 answer
942 views
Can I use the session service directly instead of via the request?
The Drupal documentation on sessions mentions that sessions can be accessed via the Request object: Session data is accessed via the \Symfony\Component\HttpFoundation\Request::getSession() method, ...
3 votes
1 answer
691 views
Is there an event related to the creation of a session cookie for anonymous users?
I need to set an additional cookie whenever an anonymous user received a session cookie. This happens when selecting a facet in Search API for example. The specific use case is that I need an extra ...
1 vote
1 answer
417 views
Token Replacement via Lazy_builder
I've spent the best part of the last day or two trying to implement lazy_builder (as seen in this brilliant tutorial https://github.com/joachim-n/drupalcon-europe-2020-lazy-builders). However, rather ...
0 votes
1 answer
107 views
Callback to Drupal site after curl call to 3rd party site doesn't resume authenticated session if more than 120 seconds elapsed since authentication
UPDATED SITUATION: A user authenticates on my site. The user selects items to purchase and is sent via curl call (see below) to a payment site. The payment site does its thing and returns to my site ...
0 votes
1 answer
2k views
Private tempstore storage contains data for previous anonymous user
I have an issue with private tempstore storage that I wasn't able to solve. I've implemented a webform handler, which populates data in this storage and then I'm creating tokens out of the saved ...