Skip to content

Instantly share code, notes, and snippets.

@amenk
Created September 4, 2019 13:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amenk/5b63ad718a5e1aece12a4760ec0053f5 to your computer and use it in GitHub Desktop.
Save amenk/5b63ad718a5e1aece12a4760ec0053f5 to your computer and use it in GitHub Desktop.
Find Magento 2 database sessions of a specific user ID
# user ID = 99 (if the ID is longer, adapat the s:2 part to the length
select FROM_UNIXTIME(session_expires), FROM_BASE64(session_data) as sd
from session
having sd like "%customer_id"";s:2:""99""%"
order by session_expires desc;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment