Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 133
  • Last Modified:

Basic Session Question

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
portal123
Asked:
portal123
  • 6
  • 3
  • 2
  • +3
1 Solution
 
jeffryanCommented:
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
 
TallerMikeCommented:
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
 
portal123Author Commented:
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 expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
MalpheusCommented:
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
 
TallerMikeCommented:
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
 
MalpheusCommented:
[error correction]
1. replace (0,45,0,0) with (0,0,45,0) :D
0
 
TallerMikeCommented:
eh, 45 hours...no big deal?  =)
0
 
HamdyHassanCommented:
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
 
anandkpCommented:
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
 
TallerMikeCommented:
Anand, I'm not sure I understand what you mean?
0
 
anandkpCommented:
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
 
TallerMikeCommented:
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
 
anandkpCommented:
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
 
TallerMikeCommented:
lol, no problem. I was just worried that I had steered someone in the wrong direction. No harm no foul.
0
 
portal123Author Commented:
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

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 6
  • 3
  • 2
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now