?
Solved

Basic Session Question

Posted on 2003-03-04
15
Medium Priority
?
129 Views
Last Modified: 2013-12-24
Hi!, guys.

session lasts for 20 minutes as default.
How do I change if I would let session lasts for 45 minutes?

Regards and BestWish, portal123
0
Comment
Question by:portal123
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
  • 2
  • +3
15 Comments
 
LVL 1

Expert Comment

by:jeffryan
ID: 8064424
I don't have MX or 5.0 install (running CG 4.5) but in my ColdFusion Administrator panel I have a Variables item an in there is the setting for the server's application session variable timeout.

You can also set the timeout for any particular application with the <cfapplication> tag.

good luck!
0
 
LVL 8

Expert Comment

by:TallerMike
ID: 8064444
You can change this time in 2 places. First is the default timeout value in the Cold Fusion administrator. This will be found under the 'Variables' link. Simply change the time of the default Session to whatever time you want as a default.

The second place is within your CFAPPLICATION tag (probably in your application.cfm file). What you'll want to do here is as follows:

<cfapplication name="myApplication"
          clientmanagement="Yes"
          sessionmanagement="Yes"
          setclientcookies="Yes"
          sessiontimeout="#CreateTimeSpan(0,0,5,0)#"
          applicationtimeout="#CreateTimeSpan(0,0,5,30)#"
          clientstorage="Cookie">

This creates a Session that lasts 5 minutes, and an application that lasts 5 minutes and 30 seconds. But you can see how you would make it something larger...
0
 

Author Comment

by:portal123
ID: 8064760
Hi, both guys, thank.

I use shared hosting, so,I cannot touch ColdFusion server.

my cfapplication tag is very simple now.

<cfapplication name="OnLineShop" sessionmanagement="yes">

So what I need to do is add

sessiontimeout="#CreateTimeSpan(0,0,5,0)#" to my cfapplication tag?

or

both sessiontimeout and applicationtimeout

to my cfappication tag?

Regards and BestWish, portal123

0
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

 
LVL 1

Expert Comment

by:Malpheus
ID: 8064994
1. adding sessiontimeout="#CreateTimeSpan(0,0,5,0)#" will make your sessions timeout after 5 minutes. Format of CreateTimeSpan parameters is days,hours,minutes,seconds. So for your 45 minute sessions it would be CreateTimeSpan(0,45,0,0).

2. generally you don't have to worry about application timeout.

3. there is a maximum timeout that can be set through cf admin and if it is lower than what you specify in the cfapplication tag, the cf admin setting will be used.

0
 
LVL 8

Accepted Solution

by:
TallerMike earned 400 total points
ID: 8064997
If you don't put and Application or Session timeout, the default values from the server will apply. So if you want to change teh session timeout from teh default sessiont imeout, then just put the sessiontimeout tag in. You can leave the applicationtimeout tag out if you just want to do the default.

<cfapplication name="OnLineShop" sessionmanagement="yes" sessiontimeout="#CreateTimeSpan(0,1,0,0)#">

This will make the session timeout after 1 hour instead of the default 20 minutes set at the server. However the application will timeout whenever the default is set to. You might want to set it yourself so you know what to expect for application timeouts...
0
 
LVL 1

Expert Comment

by:Malpheus
ID: 8065052
[error correction]
1. replace (0,45,0,0) with (0,0,45,0) :D
0
 
LVL 8

Expert Comment

by:TallerMike
ID: 8065157
eh, 45 hours...no big deal?  =)
0
 
LVL 9

Expert Comment

by:HamdyHassan
ID: 8067396
I hope it's working for you. BUT................

I remember it's very tough, even if you have CF admin rights if CF is running on IIS.

20 minutes is default session timeout at IIS and if you want to change that , you need to change it at IIS admin
0
 
LVL 17

Expert Comment

by:anandkp
ID: 8069842
mike : i dont think thats quite the case

i have a application here - & if i change my setting in CFadmin / cfapplication tag - i can keep my session varibles alive for more than 20 mins [i dont need to depend on IIS for this]

let me know

K'Rgds
Anand
0
 
LVL 8

Expert Comment

by:TallerMike
ID: 8072193
Anand, I'm not sure I understand what you mean?
0
 
LVL 17

Expert Comment

by:anandkp
ID: 8077484
Hi Mike,

what i meant was - the availibility of session variables can be made to extent beyond 20 mins [default] just by changing the settings in CFApplication tag / CFAdmin.

IIS need not come into the picture here ...

cos in my application - i had just increased the timelimit of sessions by using <cfapplication CreateTimeSpan(0,0,60,0)#"> & i cld have my session variables last for 60 mins. I didnt change ne-thing in the IIS for this ...

K'Rgds
Anand
0
 
LVL 8

Expert Comment

by:TallerMike
ID: 8080013
Anand,

Which comment did I make concerning IIS? Paste it here, I think you misunderstod me. Both of my comments pertain to changes through Cold Fusion. One through the Administrator (changing the default timeout) and the second through the CFAPPLICATION tag to change that applications specific timeout.
0
 
LVL 17

Expert Comment

by:anandkp
ID: 8086057
oops ... sorry mike - I am extremely sorry !!!

it was HamdyHassan's comment & since ur comment was exactly above that one - i misread it to be ur's ... [i guess i need to go & get my eyes checked :) cos i made a similar blunder on one of the other q's ]

I am very sorry ...
I hope u wld understand !!!

Cheers
Anand
0
 
LVL 8

Expert Comment

by:TallerMike
ID: 8088126
lol, no problem. I was just worried that I had steered someone in the wrong direction. No harm no foul.
0
 

Author Comment

by:portal123
ID: 8089160
Thank you for many advices to me, all guys.

As for almost a beginner like me, I can learn many thing from you.

I would give the extra points anandkp and Malpheus. So please find my each new posts, which say "To anandkp",
"To Malpheus".

And simply write down your name "anandkp", "Malpheus".

Thanks, all of your helps.

Regards and BestWish, portal123
0

Featured Post

Turn your laptop into a mobile console!

The CV211 Laptop USB Console Adapter provides a direct Laptop-to-Computer connection for fast and easy remote desktop access with no software to install.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question