Learn how to a build a cloud-first strategyRegister Now

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

Using sessionState in web config file

If I use this in the web config file, will it allow the FormsAuthentication to remain as an active session even if the AppDomain recycles?

<sesssionState
                 cookieless="UseCookies"
                 mode="StateServer"
                 stateConnectionString="tcpip=127.0.0.1:42424" ?>

My challenge is that I lose the FormsAuthentication info during a recycle (as you know) but I cannot adjust the server. I was hoping to set it through web config.

Thanks
0
j-w-thomas
Asked:
j-w-thomas
  • 5
  • 5
1 Solution
 
JRockFLCommented:
You can adjust it in the web.config.
If the app recycles, you will loose the active session
		<authentication mode="Forms">
			<forms name="Login" defaultUrl="Customers" loginUrl="~/Login.aspx" protection="All" timeout="40" path="/"/>
		</authentication>

Open in new window

0
 
j-w-thomasAuthor Commented:
Currently I am using this and it does ot amke any difference to the time out length at all. That is my confusion.

Further, when I copied this into the code, I realized that I had an extra bracket.
The app runs but that may explain why I was having trouble...doooohhhh

I will be back in a moment to see if that helps.
<authentication mode="Forms">
	<forms
		cookieless="UseCookies"
		timeout="45">
	</forms>
</authentication>

Open in new window

0
 
j-w-thomasAuthor Commented:
...in your first response you said that if the app recycles, I would lose the session including the FormsAuth?? True?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
JRockFLCommented:
Should be cookieless="true"
0
 
JRockFLCommented:
Yes, you will loose your session variables when the appdomain recycles.
0
 
j-w-thomasAuthor Commented:
I believe my server is set very short for memory flushes, that is why I was wondering about sessionState. This as I understand and was hoping you could clarify allows for the recycle to happen but the session variables are held out-of-process within the app.

Also I want to force cookies because of the FormAuth, and not allow anyone to use URL for settings, so shouldn't it be:

cookieless="false"  ??
0
 
JRockFLCommented:
Yes, if you want to use cookies then cookieless="false".
Do you have access to web server? This setting can be increased in IIS. The default is 20 mins.
0
 
j-w-thomasAuthor Commented:
Yes, I have full access to the server, buut admitedly I am not really familiar and don't want to do something that will create any, shall we say...issues...
0
 
JRockFLCommented:
Yes, I understand what you mean. I have answered your question?
0
 
j-w-thomasAuthor Commented:
yes, thanks for your help
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now