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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:11:24+00:00 2026-06-05T16:11:24+00:00

In my web application I want to add authorization in certain action method in

  • 0

In my web application I want to add authorization in certain action method in controller not on the whole controller. I added the following

  [Authorize]
  public ActionResult ManageResturant(long Id = 0)
  {
  }

and in web.config i added

<authentication mode="Forms" >
  <forms loginUrl="~/Auth/LogIn"/>
</authentication>

but when i go to that action method the page loads normally which is wrong i want the page to redirect to the login page

any suggestions?

  • 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-06-05T16:11:29+00:00Added an answer on June 5, 2026 at 4:11 pm

    Thanks John for your comment i really found the solution after your hint the problem was in my code

    I use a session to store the logged in user with the use of FormsAuthentication to make sure all users are login to make the login link appears to them

    the problem was when session expires the FormsAuthentication still validating the user as a logged in user so it appears that the user is logged out but in fact he is logged in using form authentication

    so what i did OnActionExecuting method i make a check on session if its null i do logout for the user so in this case i make sure that the user is logged out

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

Sidebar

Related Questions

Want to add following feature to my web application: To decode barcodes generated by
I want to add a dashboard functionality to an existing java web application, this
I want to add printing to my Javascript web application. The application is developed
I created a web application and I want to add a feature like user
We want to add tracking statistics to a web application we are building but
I am writing one web application using PHP/CodeIginter. Now, I want to add a
Q: I want to add favicon.ico to my web application .so i add the
I want to add a custom right-click menu to my web application. Can this
Hello all I want to add a text editor with my web application which
I want to add integration with a third-party service to a web application (developed

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.