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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Session Abandon

Status
Not open for further replies.

PepperPepsi

Programmer
Aug 3, 2000
241
US
Hi,

i know by calling the Session.Abandon it will end the Session. but is there any way i can just end one particular session instead of ending all the session variables?

Session("Login").Abandon
don't work =( [sig]<p>Chiu Chan<br><a href=mailto:cchan@gefmus.com>cchan@gefmus.com</a><br><a href= America, Inc</a><br>[/sig]
 
If I understand correctly you want to get rid of one session variable without ending the session itself. I would think you could just do

Session(&quot;login&quot;)=nothing

but I am not sure of that. [sig]<p>Crystal<br><a href=mailto:crystals@genesis.sk.ca>crystals@genesis.sk.ca</a><br><a href= > </a><br>--------------------------------------------------<br>
Experience is one thing you can't get for nothing.<br>
-Oscar Wilde<br>
[/sig]
 
You can &quot;abandon&quot; a session variable just by clearing it.

Here's another easy way:
Session(&quot;Login&quot;) = &quot;&quot; [sig]<p>Choo Khor<br><a href=mailto:choo.khor@intelebill.com>choo.khor@intelebill.com</a><br>[/sig]
 
Hi..

sorry i think i didn't make my question clear,
i'm working on a project that need to have about 30+ sessions, and i'm worry about keeping a lot of session will slow down the server, since they are store in the server memory and there will be approx 5000 users visit every hour. So what i'm trying to do is remove only &quot;SOME&quot; session from memory but by doing session.abandon it will remove all of the sessions.

by the way, what happen if i store all the information into one session and seperate them by &quot;,&quot; so that i will only have one session create, will that help increase the performance?

for example:

Session(&quot;Login&quot;) = &quot;Username=&quot; & username & &quot;, Password=&quot; & password&quot; etc..

thanks



[sig]<p>Chiu Chan<br><a href=mailto:cchan@gefmus.com>cchan@gefmus.com</a><br><a href= America, Inc</a><br>[/sig]
 
Hi Chiu

Actually, you can even keep those 30+ variables in a Session array. I'm not sure about performance; that's something you'll need to test with. It sounds like you're building a pretty high traffic site. I would definitely recommend against using sessions.

Have you considered using a database to keep &quot;session&quot; information instead?
[sig]<p>Choo Khor<br><a href=mailto:choo.khor@intelebill.com>choo.khor@intelebill.com</a><br>[/sig]
 
Choo Khor,

thanks for your reply,
what kind of database will you recommend to use?
I'm also thinking to maintain all session on client cookies, but the disadantages of that are the security issue. Also, does anyone have any idea to solve the &quot;Web Farm&quot; problem? because for this project, there will be multiple servers are used to host the same site.

thanks [sig]<p>Chiu Chan<br><a href=mailto:cchan@gefmus.com>cchan@gefmus.com</a><br><a href= America, Inc</a><br>[/sig]
 
Chiu,

You definitely would not want to use Session variables if multiple servers are involved. Session and Application variables reside on a particular server, and is not accessible from other servers.

As to the choice of database, it really depends on the amount of data you need to maintain. If you have access to SQL Server and are already using it, that will be the best choice (more scalable).
[sig]<p>Choo Khor<br><a href=mailto:choo.khor@intelebill.com>choo.khor@intelebill.com</a><br>[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top