Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsProvidersProvidersAlternative To Session Variables?Alternative To Session Variables?
Previous
 
Next
New Post
11/21/2011 8:26 AM
 

I've read that SESSION VARIABLES are a "bad" thing. And I do understand the thought behind it, since it would be problomatic in a Server Farm environment.  However, I have the following questions:

1) Is there any alternative offered by the DNN Core to SESSION VARIABLES? I looked into User Personalization, but I don't want the data saved permanently for the user, only temporarily for the current login session.
2) Does DNN (Version 6) create any Unique ID at the time of Login that I can use to label saved data in a custom table on the SQL Server? Something that gets tossed immediately at time of Logout.

The reason I ask #2, is because I found that if I store some data in a SESSION VARIABLE, if a user logs out, and logs back in, the SESSION VARIABLE data remains. I added a SESSION.ABANDON() command to the LogOff routine which fixed this, but I assume that I would not be able to use a SESSION_ID number, because obviously Logging out of DNN doesn't reset the session.

Help!  :-)


Ben Santiago, MCP Certified & A+ Certified
Programmer Analyst
(SQL, FoxPro, VB, VB.Net, Java, HTML, ASP, JSP, VBS, Cognos ReportNet)
 
New Post
11/21/2011 5:51 PM
 

A web pages Session is not a Authoritive element - a session exists for the duration of a web browsers connection to a server - well at least in theory.  As such that session exists regardless of whether a user is logged in to a web site or not since the session is controlled by the web server not the web application.

This has to be the case since one of the most common users of the session id is for shopping carts where for the most part there is no user logged in.

Westa

 
New Post
11/21/2011 10:34 PM
 

Wes,
   Thanks for your input. :-) This is basically why I am looking for alternatives. Right now SESSION VARIABLES are working, however if the Module I am creating is installed on a WebFarm...then I'll have trouble. I am trying to head off the problem before it becomes one.


Ben Santiago, MCP Certified & A+ Certified
Programmer Analyst
(SQL, FoxPro, VB, VB.Net, Java, HTML, ASP, JSP, VBS, Cognos ReportNet)
 
New Post
11/22/2011 7:34 PM
 
you may either use cookies or data stored in the database.

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
11/22/2011 8:41 PM
 

Well yes, that what I was talking about doing, using the DB to store the data.  However, without somehow "marking" the saved data with some sort of UniqueID that is used just for that current login, there is no easy way to know what data to then delete later. That is what I need, the ability to store data but just for the current login session. The problem with Cookies and saving data in the DB directly, is that the data persists after the person logs out.

The best solution I think is to store the data in the database, but without a unique login-specific ID...there is no way for me to expunge the data after a user logs out. The only thing I might be able to try is stamping the DATETIME to any records and have my module check periodically and delete "expired" data (which would simply be some sort of timeout/TTL value I suppose. Or if possible, check if the owner of said data is still actively logged in and delete the stored data if not. This way the data doesn't accumulate in the database.  But the latter idea would only work if the DNN site in question has login tracking activated.

It would have been much easier if the DNN Authentication Provider created a unique Login-Session ID that is valid for that current login only, which could be retrieved and used by any module. But I guess that is no such thing and I just have to either come up with my own method, or just stick with my SESSION VARIABLES and cross my fingers no one installs it on a server farm.


Ben Santiago, MCP Certified & A+ Certified
Programmer Analyst
(SQL, FoxPro, VB, VB.Net, Java, HTML, ASP, JSP, VBS, Cognos ReportNet)
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsProvidersProvidersAlternative To Session Variables?Alternative To Session Variables?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out