Click here to Skip to main content
11,701,904 members (46,980 online)
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 12: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 Maciej Los 380
1 OriginalGriff 314
2 Sergey Alexandrovich Kryukov 310
3 Mika Wendelius 119
4 CHill60 105
0 OriginalGriff 8,324
1 Sergey Alexandrovich Kryukov 7,422
2 CPallini 4,912
3 Maciej Los 4,196
4 Mika Wendelius 3,556

Advertise | Privacy | Mobile
Web02 | 2.8.150819.1 | Last Updated 19 Sep 2012
Copyright © CodeProject, 1999-2015
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