By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,851 Members | 983 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,851 IT Pros & Developers. It's quick & easy.

Session state null in profile provider

P: n/a
hi all,

I am writing a custom profile provider to save my business object as one
of the properties of the profile

however i am facing a problem'

the HttpContext.Current.Session property is valid in in the Get
PropertyValues method,

but its null in the SetPropertyValues method

is this how its supposed to work ?, i checked my web.config and session
is enabled, i can also confirm that session variables are working
properly on pages ...
Thanks

Jan 18 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi Ashish,
This is because the ProfileProvider will save the values in its
properties to the datastore at the end of each request as its
'automaticSaveEnabled' attribute is true by default. And at the end of
request, the session will not be available as its life time expires before
request ends.

Solution:
In the web.config, set "automaticSaveEnabled = false" in the profile tag.
In this case you will have to call Profile.Save() method explicitely to save
the profile values to the datastore.

Regards
Ranji.

"ashish" wrote:
hi all,

I am writing a custom profile provider to save my business object as one
of the properties of the profile

however i am facing a problem'

the HttpContext.Current.Session property is valid in in the Get
PropertyValues method,

but its null in the SetPropertyValues method

is this how its supposed to work ?, i checked my web.config and session
is enabled, i can also confirm that session variables are working
properly on pages ...
Thanks

Mar 19 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.