Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Session.Contents Values forgotten after a period of time

Posted on 2014-09-04
3
Medium Priority
?
299 Views
Last Modified: 2014-09-05
I've written a utility to assist my corps DBA's in managing User Access, in order to do this some users who don't have administrative privileges to the DB are provided w/ a pass-thru ID and password.  I save these values in 'Session.Content("Var")' variables when the user initially logs in but it seems that after a period of say 10-20 minutes of non-use the values are "forgotten."  Basically after this period the variable is null or blank and therefore when I try to connect to the database using it I get an error saying that the value is invalid.  Is there any way to store these variables securely and insure that they won't be forgotten after a period of time?  Thanks.
0
Comment
Question by:EDW_Gideon
3 Comments
 
LVL 15

Expert Comment

by:ChloesDad
ID: 40304655
You can save them in a cookie and put an expiry date on the cookie of say 1 hour (or whatever you feel is appropriate. They should time out eventually, as keeping them permanently is not a good idea.
0
 
LVL 12

Accepted Solution

by:
Ramkisan Jagtap earned 2000 total points
ID: 40305131
You can increase the session timeout in the web.config Something like:

<configuration>
  <system.web>
     <sessionState timeout="20"></sessionState>
  </system.web>
</configuration>

 where you can "timeout" time as per your convinience
0
 

Author Closing Comment

by:EDW_Gideon
ID: 40306035
AWESOME!  Thank you Ramkisan!!!
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

876 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question