How to get the user currently logged in based on stored cookies?
See original GitHub issueGeneral Question
Read the Notes and fill out the form.
Switch to Preview
for reading.
Notes
Your issue will be closed if you violate any rule below.
- You need to include a meaningful descriptions and e.g. a screenshot.
- You do not include screenshots of your code.
- Read the Docs.
- Capturing endpoints and similar can be found here (read it if you are going to ask about it).
- You can delete this section after reading it.
Form
Put an [x]
if you meet the condition, else leave [ ]
.
- I’ve searched the Issues
- I’ve read the basic concepts
- I’m using the latest version
Question
How to get the user information currently logged in based on stored cookies? Do I need to login again or can I get that saved status information?
I am looking for this response data:
{
pk: number;
username: string;
full_name: string;
is_private: boolean;
profile_pic_url: string;
profile_pic_id: string;
is_verified: boolean;
has_anonymous_profile_picture: boolean;
can_boost_post: boolean;
is_business: boolean;
account_type: number;
is_call_to_action_enabled: null;
can_see_organic_insights: boolean;
show_insights_terms: boolean;
reel_auto_archive: string;
has_placed_orders: boolean;
allowed_commenter_type: string;
nametag: AccountRepositoryLoginResponseNametag;
allow_contacts_sync: boolean;
phone_number: string;
country_code: number;
national_number: number;
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
How to make use of a cookie to get logged through the browser?
The first command below can be executed in the terminal or Postman, for the username value you can use either your email or...
Read more >Storing login information in Cookies - Stack Overflow
One approach you might want to consider is simply storing the user's ID in the cookie, but also having a non-persistent authenticated cookie....
Read more >How to Get the Current User in React from JWT in Cookie
Learn how to get the current user when your storing the jwt in a cookie.Code is from this series: ...
Read more >How to Authenticate Users in Your Node App with Cookies ...
You can check the cookie that's stored by navigating to the Storage section of your browser developer tools and going to the Cookies...
Read more >Store username in cookie for a web site
This entirely depends on what you are doing with the username stored in the cookie. If you are automatically trusting that the username...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
ig.state.cookieUserId
contains the current user id. So to get the user info you can do this:ig.user.info(ig.state.cookieUserId)
.how use this for skipping login process ?