473,406 Members | 2,345 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

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 1789
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
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...
10
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...
6
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...
5
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. ...
2
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(...)...
7
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...
3
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,...
5
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...
1
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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...

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.