473,756 Members | 1,969 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Deleting folders clears session variables

I'm having a problem and I can't find anything about this anywhere else
out there.

I'm working on a solution that allows the end user to create folders /
upload files to the web server. Some pertinent information is being
stored in a session variable. If a user deletes the folder from the
application, it clears any session variables as if deleting a folder
made a call to Session.Abandon (). This also occurs if I delete the
folder through Windows Explorer and then go back to the web browser,
the session variables are cleared.

Anyone else running into this problem? Have I done something wrong? Is
my server not configured properly?

Nov 20 '05 #1
4 1805
Forgot to mention this is using the 2.0 Beta 2 Framework.

Nov 20 '05 #2
I suspect ASP.NET detects the filesystem change as significant enough to
restart the AppDomain. If you store your session out of process (in the NT
State Server, or a SqlServer/SqlExpress database) then you'll be ok.

As a side note, I'd strongly suggest not allowing people to upload context
into your web application directory structure. They could upload code (such
as an ASPX file) that executes on the server and does things you don't want
them to do. I'd suggest allowing them to upload to a different directory
that's configured in IIS as an application. If you want users to be able
to upload content that is accessible via the web application, then perhaps
save it in a database instead and write a specific handler or page to allow
retrieval of that data.

-Brock
DevelopMentor
http://staff.develop.com/ballen
I'm having a problem and I can't find anything about this anywhere
else out there.

I'm working on a solution that allows the end user to create folders /
upload files to the web server. Some pertinent information is being
stored in a session variable. If a user deletes the folder from the
application, it clears any session variables as if deleting a folder
made a call to Session.Abandon (). This also occurs if I delete the
folder through Windows Explorer and then go back to the web browser,
the session variables are cleared.

Anyone else running into this problem? Have I done something wrong? Is
my server not configured properly?

Nov 20 '05 #3
Gah, sorry, full of typos. That's what I get for typing and talking on the
phone at the same time. Ok, fixed version:

I suspect ASP.NET detects the filesystem change as significant enough to
restart the AppDomain. If you store your session out of process (in the NT
State Server, or a SqlServer/SqlExpress database) then you'll be ok.

As a side note, I'd strongly suggest not allowing people to upload content
into your web application directory structure. They could upload code (such
as an ASPX file) that executes on the server and does things you don't want
them to do. I'd suggest allowing them to upload to a different directory
that's not configured in IIS as an application. If you want users to be able
to upload content that is accessible via the web application, then perhaps
save it in a database instead and write a specific handler or page to allow
retrieval of that data.

-Brock
DevelopMentor
http://staff.develop.com/ballen
Nov 20 '05 #4
osh
Brock,

Thanks for a quick response.

If the AppDomain is being restarted with any file system change, would
that not also log the user out of the system (I'm using forms
authentication) . It's not doing a sign out from forms authentication,
rather its just clearing the session variables.

Your suggestion, for example, you are saying that if my application is
in /intranet/ that the uploads should be posted to a different
directory outside of this web application?

I thought the users would try to upload ASPX or other code, and what
the user can upload is limited from both file extension and file
content type. File names are also encrypted and I wrote a handler that
will serve a requested file to the end user upon request without
revealing the URL. I'm using a databse to keep track of almost a "mock"
directory structure - but the physical paths/files themselves are never
revealed during browsing, uploading, or downloading. Think thats
enough?

Thanks!

Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1152
by: Simon Harvey | last post by:
Hi all, Is it prudent to delete items that you've stored in the session if you are sure that these values won't be needed again? I'm also wondering if things would be arsed up if the user went to a page that deleted session information and then used his/her back button to go to a precious page. Presumably the session data would be gone and my app would get mighty pissed
10
3514
by: tshad | last post by:
I have been using the default session state (InProc) and have found that I have been loosing my information after a period of time (normally 20 minutes). Is there anyway to find out how much more time I have on a session? If I do a refresh, does reset the session clock? Do you have have to go to another page to reset the session timeout or will a postback also do it? This is important as we have a few pages that a user
6
4607
by: Martin Bischoff | last post by:
Hi, I'm creating temporary directories in my web app (e.g. ~/data/temp/temp123) to allow users to upload files. When I later delete these directories (from the code behind), the application restarts and all active sessions are terminated. This error is also described in detail here:...
5
2690
by: George | last post by:
VB.net 2003 standard, XP windows home edition. Installed first application OK today. When I removed the application via Control Panel, there were no problems and the app folders were deleted. But when I installed the app from a CD-ROM (Release folder is in D:), when I remove the app in Control Panel these problems occur: Control Panel does not delete the application folders. When I try to delete them I get message "Cannot delete file:...
2
2410
by: Cesar Ronchese | last post by:
Hello, I'm experiencing a very weird problem. I have a ASP.Net 2005 application (VB.Net) that creates some folders to store temporary files. example: Session_Start(...) IO.Directory.CreateDirectory(Server.MapPath(".") & "\SessionFolders\" & Session.SessionID) (...) The same application holds a session object that logs on to my server application (desktop - non ASP), that shows all connected clients in a listview. See sample code:
7
1834
by: eSolTec, Inc. 501(c)(3) | last post by:
Thank you in advance for any and all assistance. I have an application that pulls files, folders and registry keys of installed programs. I'm wanting to with a context menu selection of "Delete Selected", delete "ALL" of the checked selected files, folders, registry keys. Can someone show me some code to do this please?
3
2922
by: Kimera.Kimera | last post by:
I'm trying to write a program in VB.net 2003 that basically deletes all files, folders, sub-folders and sub-sub folders (etc). The program is simply for deleting the Windows/Temp folder contents, removing all the files/folders inside it. The problem i am having is that i can only delete files in the Windows/Temp folder, and i can't delete folders if they contain files, i know that you can't do this.
5
1282
by: jawloc | last post by:
Hi I have a question that I hope someone can help me with. I have created a web page that allows a user to upload an image with a caption to my web server. Here is what happens when the user loads the page: 1 - A temporary folder is created with that user's username here is an example of the folder "c:\wwwroot\upload\tmp\username". 2 - The user uploads the file it gets saved in the temp folder.
1
1640
by: tkondal | last post by:
Hi, I have been looking into making my file cleaning script more intelligent. The goal of the script is to delete everything on a drive except for a couple of folders which are skipped by the script. Recently, I noticed that some files where not being deleted because a process was using them. Is there a recipe (needs to run on Windows XP/ 2003) for doing the following (more specifically, I need a way to determine which process is...
0
9455
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9271
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9869
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8709
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7242
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5140
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5302
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3354
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2665
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.