Click here to Skip to main content
13,143,185 members (60,234 online)
Rate this:
Please Sign up or sign in to vote.
See more:

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 19-Sep-12 4:38am
rk_prabakar 19-Sep-12 4:48am
Thanks pal
cm_Aryan 19-Sep-12 10:32am
Thanks Buddy
rk_prabakar 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
Top Experts
Last 24hrsThis month

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