Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Session Variable alternatives

Status
Not open for further replies.

primagic

IS-IT--Management
Jul 24, 2008
476
GB
I am curently using a session variable to get the current logged in user, then linking their records (invoices and so on) to that session. I have been reading a few articles saying that session variables probably aren't the most robust and I should try an alternative.

I have read about the alternatives but was just wondering if anyone would recommend a particular alternative.

Thanks
 
There is nothing wrong with using session, it all depends on your needs.

Session is good(and we use it) to hold a user object. This way if the session ends, they have to log back in.
If that is something you want to avoid, then you would have to hit the db each time to get the user info. That is something that may or may not be accetable.

Again, there really isn't a right or wrong way, just different ways for different needs. You could use a way that is not really meant for you needs. But first you have to determine what it is that you need to do, or need to avoid.
 
Thanks for your response. I am mainly using the session varibale to link data to whoever is logged in?

so if user 12345 logs in, then I can retrieve and display just their orders.

these websites will be hosted on share hosting/reseller hosting to I wouldnt have access to IIS to change the timeout period. Is there a way to override this in the web.config file or anywhere else?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top