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 7666187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:46:15+00:00 2026-05-31T14:46:15+00:00

I am writing a content management system where the user can create multiple sites

  • 0

I am writing a content management system where the user can create multiple sites inside the app. Each site can have authentication. I am trying to figure out how to have multiple authentication cookies for the app without having to add each one to the web.config. I need to create them programmatically when the application starts up. Is this possible?

Ex.

SecureApp: http://localhost/CTMS – Needs authentication to update sites

CustomSite: http://localhost/CTMS/Custom1 – Needs authentication separate from SecureApp

Hopefully this makes sense.

  • 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-31T14:46:16+00:00Added an answer on May 31, 2026 at 2:46 pm

    You can do this –

    FormsAuthenticationTicket _ticket = new FormsAuthenticationTicket(_version, _name, _issueDate, _expirationDate, _isPersistent, _userData, _cookiePath);
    
    string _encryptedTicket = FormsAuthentication.Encrypt(_ticket);
    
    HttpCookie _cookie = new HttpCookie("customticket", _encryptedTicket);
    
    HttpContext.Current.Response.Cookies.Add(_cookie);
    

    Then you can write code to check incoming requests to see if they have this cookie –

    HttpCookie _cookie = HttpContext.Current.Request.Cookies["customticket"];
    
    if(_cookie){
    
    _encryptedTicket = _cookie.Value;
    FormsAuthenticationTicket _ticket = FormsAuthentication.Decrypt(_encryptedTicket);
    
        if(!_ticket.Expired) {
            IIdentity _identity = new FormsIdentity(_ticket);
            IPrincipal _principal = new GenericPrincipal(_identity, new string[0]); //Identity plus string of roles.
        }
    }
    else{
    //dostuff
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a simple content management system. I need to store SHA1 hash values
I'm writing a Content Management System in PHP, and I want it to be
I am writing a content management system using JQuery.ajax & C#. The JQuery calls
Can someone help in writing a Custom Content Provider for Multiple tables. I can
So I have some particular variables that mess up the content management system I'm
Background I am writing and using a very simple CGI-based (Perl) content management tool
I'm have a StringBuilder that is writing content to a file. Towards the end
I'm writing an C# App (WinForm) with a ListBox having content added by the
I am writing a script for renaming/copying the content of a file. I have
I'm writing a form in XAML that has multiple buttons with content of different

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.