Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: ASP
When i am working with Sessions in Classic ASP, I checked that session variables are not destroying after the session TIMEOUT. Below is my Code
ASP Code
Dim sessid, Uname
Session.Timeout = 1
uname= Session("Uname")
Response.Write("The timeout is:" & Session.Timeout)
<!DOCTYPE html>
	<h1> user Login form</h2>
	<form method="post" action="vbscript.asp">
		<label>username: </label> <input type="text" id="uname" value="" name="uname" />
		<label>password: </label> <input type="text" id="pwd" value="" name="pwd" />		
		<input type="submit" id="login_btn" value="Login" />
Initially i set Session.Timeout to 1. After 2 minutes when i try to refresh vbscript.asp page i am still able to see the session("Uname") value same, which has to be destroyed.
Can you Clarify me on this if i am wrong about Sessions Concept. Actually I am new to Classic ASP
Posted 18-Sep-12 13:35pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Hi Aryan,
It seems that you are just letting your application should expire after 1 min by setting the Session.Timeout = 1 option, fine but you are not clearing the session variable.
You should clear the session variable in Session_OnEnd method in Global.asa file.
I hope this would help you to resolve the issue.
Please refer this link[^]
ssd_coolguy at 19-Sep-12 4:38am
rk_prabakar at 19-Sep-12 4:48am
Thanks pal
cm_Aryan at 19-Sep-12 10:32am
Thanks Buddy
rk_prabakar at 20-Sep-12 5:11am
always welcome pal....

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 DamithSL 370
1 Maciej Los 217
2 OriginalGriff 213
3 BillWoodruff 135
4 Zoltán Zörgő 85
0 OriginalGriff 7,953
1 DamithSL 6,139
2 Sergey Alexandrovich Kryukov 5,454
3 Maciej Los 5,293
4 Kornfeld Eliyahu Peter 4,539

Advertise | Privacy | Mobile
Web04 | 2.8.141223.1 | Last Updated 19 Sep 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100