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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:26:19+00:00 2026-06-18T06:26:19+00:00

I have a Web Project which has a Business Layer that handles some data

  • 0

I have a Web Project which has a Business Layer that handles some data operations. I would like to secure some or all methods by checking if there is an active not ended valid Session before executing the method.

I first thought using Attribute over class but I couldn’t run it properly. Since the class is a usual class and not derived from System.Web.Page. the attribute class never runs when the required BL instance is invoked. Besides, some of the methods might not require a valid session, so the whole class might not need a complete security. And also, adding a line that checks the session in every beginning of the method doesn’t sound very promising.

If you ask me why would I need to secure by method, I could explain like this:

  • This is a web project
  • Person might start out the from fill it but never got it save at that moment
  • That screen waits about 30 mins lets say
  • The session is already ended
  • User is back in front of the computer, and clicks SAVE button, but process should NOT be completed

Save operation could easily be a DELETE operation or a SELECT.

Since there are many TYPEs of forms and stuff, I have BL.ItemManager, BL.VideoManager, BL.ServiceManager and so on… So, there are alot of save, delete and select methods inside of these classes.

Therefore, is there a neat way to secure some methods by checking the session before running the process

  • 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-18T06:26:20+00:00Added an answer on June 18, 2026 at 6:26 am

    You may use aspect-oriented approach; PostSharp may be an option.

    All you need to do is to create an atrribute using PostSharp to inject code before the method call to check whether the session is alive. Something like;

    [SessionAlive]
    public void SomeMethod()
    

    Or you may just use Session_End method in the Global.asax file, or you may just use some javascript code to force redirection to login page.

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

Sidebar

Related Questions

I have an ASP.NET project which has already some custom fields in it's web.config
In my ASP.NET Web-form Project I have an Event which Export Data ( List<Profit>
I have a solution in VS 2008 which has one web project and 3
Hi I have a MVC 3 web project which has been deployed to Azure
I have two projects, the DLL project which has all my logic and data
I have a Dynamic Web Project in Eclipse which has a dependency to another
I have an ASP.NET web application project which references another project called ModusCore (or
I have built a web setup project in VS2008 which installs my ASP.NET/Silverlight app
I have developed a web project. Which is generating log file using log4j. But
I'm working on a web project, which have to process so many client requests.

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.