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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:25:55+00:00 2026-05-13T20:25:55+00:00

I have the following settings in my web.config file. It basically restricts access to

  • 0

I have the following settings in my web.config file. It basically restricts access to a page if the user is not logged in. If I don’t want to use the asp login controls or implement a membership provider, how can I ‘tell’ asp that the loginregister.aspx page has authorized the request if I want to implement my own login system?

Thanks.

<authentication mode="Forms">
            <forms loginUrl="~/loginregister.aspx"
                   name=".ASPXFORMSAUTH" />
        </authentication>

        <authorization>
            <deny users="?" />
        </authorization>

<location path="~/secretpage.aspx" allowOverride="true">
        <system.web>
            <compilation debug="true" />
            <authorization>
                <deny users="?" />
            </authorization>
        </system.web>
    </location>
  • 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-13T20:25:55+00:00Added an answer on May 13, 2026 at 8:25 pm

    After you validate your user, set a ticket….

        Response.Cookies.Add(TicketHelper.CreateAuthCookie(Login1.UserName, userData, Login1.RememberMeSet /*persistent cookie*/));
    

    using this helper class…

    If using a login control, do it in Authenticated event handler.

    using System;
    using System.Web;
    using System.Web.Security;
    
    namespace CustomAuthRepurposingFormsAuth
    {
        public static class TicketHelper
        {
            /// <summary>
            /// 
            /// </summary>
            /// <param name="userName"></param>
            /// <param name="userData">be mindful of the cookie size or you will be chasing ghosts</param>
            /// <param name="persistent"></param>
            /// <returns></returns>
            public static HttpCookie CreateAuthCookie(string userName, string userData, bool persistent)
            {
                DateTime issued = DateTime.Now;
                // formsAuth does not expose timeout!? have to hack around the
                // spoiled parts and keep moving..
                HttpCookie fooCookie = FormsAuthentication.GetAuthCookie("foo", true);
                int formsTimeout = Convert.ToInt32((fooCookie.Expires - DateTime.Now).TotalMinutes);
    
                DateTime expiration = DateTime.Now.AddMinutes(formsTimeout);
                string cookiePath = FormsAuthentication.FormsCookiePath;
    
                var ticket = new FormsAuthenticationTicket(0, userName, issued, expiration, true, userData, cookiePath);
                return CreateAuthCookie(ticket, expiration, persistent);
            }
    
            public static HttpCookie CreateAuthCookie(FormsAuthenticationTicket ticket, DateTime expiration, bool persistent)
            {
                string creamyFilling = FormsAuthentication.Encrypt(ticket);
                var cookie = new HttpCookie(FormsAuthentication.FormsCookieName, creamyFilling)
                                 {
                                     Domain = FormsAuthentication.CookieDomain,
                                     Path = FormsAuthentication.FormsCookiePath
                                 };
                if (persistent)
                {
                    cookie.Expires = expiration;
                }
    
                return cookie;
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Assume I have the following in my web.config (most of the file omitted for
Moved to ef 4.3 with AutomaticMigrationsEnabled = true; In web.config have the following settings:
I have following in my config.php file for one of my web app. //db
In my Web.config file have the following setup: <add key=ClientMail value=ridermansb@bindsolution.com/> In my file
I have the following authorization settings in my web.config: <authorization> <deny users=? /> </authorization>
If I have the following setting in my app.config file. It is a setting
I have the following in my web.config <connectionStrings> <add name=ActiveDirectoryConnection connectionString=LDAP://ActiveDirectoryDomain1.com providerName=System.Web.Security.ActiveDirectoryMembershipProvider/> </connectionStrings> I
I have developed chart rendering functionality in my web application and set following setting
I have created a sitecollection and in AAM I have made following settings for
I have the following code in settings.py #EMAIL_USE_TLS = True EMAIL_HOST = 'smtp.gmail.com' EMAIL_HOST_USER

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.