alien
alien

Reputation: 29

asp session timeout not working properly

i want sessions not to disappear after default 20 min so i wrote this code

    <% 

Session("userid")=rsGuestbook("UserID")
Session("TitleofTheme")=rsGuestbook("TitleofTheme")
Session("Compare")=rsGuestbook("Compare")
Session("Thecontect")=rsGuestbook("Thecontect")
Session("LastUpdate")=rsGuestbook("LastUpdate")
Session("RequestID")=rsGuestbook("RequestID")

userID=Session("userid")

session.timeout=600 %>

in the asp file but somehow it still 20...

<% Response.Write(Session.timeout) %>

it shows me 600 but correspond to 20

i did read a few answers here but found nun good answer for why exactly and what else is missing in my code be glad for quick fix and no i don't want to use cookies.

ANSWER : it was the server side fault or better say "recycle pool" just make it longer to clean and the sessions will be hold longer

Upvotes: 2

Views: 1322

Answers (3)

schudel
schudel

Reputation: 1225

If the site is low traffic your application pool might recycle after 20 minutes. So setting a higher "idle time out (minutes)" in the advanced settings of the associated application pool might help

Upvotes: 1

Control Freak
Control Freak

Reputation: 13233

You can do this in IIS.

Goto the IIS Console then goto on ASP > Session Properties > Timeout

You'll see the default value of 00:20:00

You can change that to your liking.

Note: This will take affect on all files and sub-directories on the level you apply it on.

Upvotes: 0

pee2pee
pee2pee

Reputation: 3792

You have to set session.timeout=600 on each page - what IIS version are you using?

IIS 7 Classic ASP session for website, website subdirectory, application inside website

Upvotes: 0

Related Questions