Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5978177
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:28:36+00:00 2026-05-22T21:28:36+00:00

I have a authentication cookie and I was wondering if it would be possible

  • 0

I have a authentication cookie and I was wondering if it would be possible extract data from the cookie in the asp.net part of the code (i.e in the HTML part) .I am able to pull it out in the backend using the code below

IPrincipal p = HttpContext.Current.User;
            // p.Identity.Name : this is what we will use to call the stored procedure to get the data and populate it


            string userid = p.Identity.Name;
            Response.Write("Welcome  " +
                p.Identity.Name);
            var dbcontext = new PrepLicensingSolution2010.DAL.LicensingEntities1();
            if (userid != null)
            {
                var user = dbcontext.commissions_proc(userid);
            }

But can this be done in the front end?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T21:28:37+00:00Added an answer on May 22, 2026 at 9:28 pm

    That depends on how the auth cookie is set. If HTTPOnly is used it cannot be accessed by javascript or (if the browser is secure) client side.

    To access a cookie in Javascript just use

    var myCookieArray = document.cookie.split(";");

    And loop through the array to find the cookie you are looking for.

    More info available here: http://www.w3schools.com/JS/js_cookies.asp

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's what i have : ASP.NET 4.0 Web Application Forms Authentication (Cookie Based) Here's
I have a kind of asp.net forms authentication with the code like that: FormsAuthentication.SetAuthCookie(account.Id.ToString(),
I have one application which uses the standard .NET forms authentication cookie, now I
I have authentication mode set to forms in my asp.net web.config but am still
I have an ASP.NET WebForms page with forms authentication. When users create a login,
I have authentication code: var authTicket = new FormsAuthenticationTicket(/*blahblah....*/); var cookie = new HttpCookie(FormsAuthentication.FormsCookieName,
I have an asp.net website that uses forms authentication. There are a few things
I have Forms authentication setup for an ASP.NET 4.0 application on http://example.com - we'll
I have the following code in my asp.net login page: if (Request.QueryString[ReturnUrl] != null)
It looks like JavaScript does not have access to authentication cookies ('ASP.NET_SessionId', '.ASPXFORMSAUTH') in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.