Showing posts with label values. Show all posts
Showing posts with label values. Show all posts

Saturday, March 31, 2012

Session values across subdomains

Is it possible to keep sessions between subdomains?
I.e
If I have a site "shop.com" and when user acess his personal page it's
"secure.shop.com"
Is it possible to share the session values between these two?
Why I ask is because the hosting company gives a discount on SSL
certificates if I put it at secure.shop.com instead of the entire site
and since I only need checkout and personal info pages to be secure I
was thinking that I could put that info in the secure.shop.com domain
but I am worried I will loose session info like cartid, userid and
such..
Regards,
Danielit depends. to share the session cookie, you override the domain in the
session cookie, pretty simple. if secure.shop.com and shop.com are the
same site then you are done. if they are different sites and you use
inproc session, then you will need some way to pass session data from
one site to another (say a web service).
-- bruce (sqlwork.com)
daniel.westerberg@.ruilong.se wrote:
> Is it possible to keep sessions between subdomains?
> I.e
> If I have a site "shop.com" and when user acess his personal page it's
> "secure.shop.com"
> Is it possible to share the session values between these two?
> Why I ask is because the hosting company gives a discount on SSL
> certificates if I put it at secure.shop.com instead of the entire site
> and since I only need checkout and personal info pages to be secure I
> was thinking that I could put that info in the secure.shop.com domain
> but I am worried I will loose session info like cartid, userid and
> such..
> Regards,
> Daniel

Thursday, March 29, 2012

Session values across subdomains

Is it possible to keep sessions between subdomains?
I.e
If I have a site "shop.com" and when user acess his personal page it's
"secure.shop.com"
Is it possible to share the session values between these two?
Why I ask is because the hosting company gives a discount on SSL
certificates if I put it at secure.shop.com instead of the entire site
and since I only need checkout and personal info pages to be secure I
was thinking that I could put that info in the secure.shop.com domain
but I am worried I will loose session info like cartid, userid and
such..

Regards,
Danielit depends. to share the session cookie, you override the domain in the
session cookie, pretty simple. if secure.shop.com and shop.com are the
same site then you are done. if they are different sites and you use
inproc session, then you will need some way to pass session data from
one site to another (say a web service).

-- bruce (sqlwork.com)

daniel.westerberg@.ruilong.se wrote:

Quote:

Originally Posted by

Is it possible to keep sessions between subdomains?
I.e
If I have a site "shop.com" and when user acess his personal page it's
"secure.shop.com"
Is it possible to share the session values between these two?
Why I ask is because the hosting company gives a discount on SSL
certificates if I put it at secure.shop.com instead of the entire site
and since I only need checkout and personal info pages to be secure I
was thinking that I could put that info in the secure.shop.com domain
but I am worried I will loose session info like cartid, userid and
such..
>
Regards,
Daniel

session values

I'm having a problem with sessions. Basically, my site has a place where a
user logs in, and they're taken to a page with the order details and items
from their shopping cart. This order detail page checks a session variable to
check that the customer is logged in. The problem is that some users are
taken back to the login page even though they are entering the correct
username and password. We know that their cookies are on. We have a script on
another page that checks for cookies, and we've scanned through the logs and
it shows that their cookies are on. What is more baffling is that many users
are going through ok, but some are not, and there aren't any patterns as to
their browser type, or isp origin or whatnot. Anyone have a similar issue?Are you using Forms Authentication? If not, you may find that arrangement
more reliable. You can easily set up custom Forms Auth against a database.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com

"George" wrote:

> I'm having a problem with sessions. Basically, my site has a place where a
> user logs in, and they're taken to a page with the order details and items
> from their shopping cart. This order detail page checks a session variable to
> check that the customer is logged in. The problem is that some users are
> taken back to the login page even though they are entering the correct
> username and password. We know that their cookies are on. We have a script on
> another page that checks for cookies, and we've scanned through the logs and
> it shows that their cookies are on. What is more baffling is that many users
> are going through ok, but some are not, and there aren't any patterns as to
> their browser type, or isp origin or whatnot. Anyone have a similar issue?
>

session values

I'm having a problem with sessions. Basically, my site has a place where a
user logs in, and they're taken to a page with the order details and items
from their shopping cart. This order detail page checks a session variable t
o
check that the customer is logged in. The problem is that some users are
taken back to the login page even though they are entering the correct
username and password. We know that their cookies are on. We have a script o
n
another page that checks for cookies, and we've scanned through the logs and
it shows that their cookies are on. What is more baffling is that many users
are going through ok, but some are not, and there aren't any patterns as to
their browser type, or isp origin or whatnot. Anyone have a similar issue?Are you using Forms Authentication? If not, you may find that arrangement
more reliable. You can easily set up custom Forms Auth against a database.
Peter
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
"George" wrote:

> I'm having a problem with sessions. Basically, my site has a place where a
> user logs in, and they're taken to a page with the order details and items
> from their shopping cart. This order detail page checks a session variable
to
> check that the customer is logged in. The problem is that some users are
> taken back to the login page even though they are entering the correct
> username and password. We know that their cookies are on. We have a script
on
> another page that checks for cookies, and we've scanned through the logs a
nd
> it shows that their cookies are on. What is more baffling is that many use
rs
> are going through ok, but some are not, and there aren't any patterns as t
o
> their browser type, or isp origin or whatnot. Anyone have a similar issue?
>

Session Values are lost

Hello everyone,

I have a problem I have no idea why it happens.
I have an ASP.NET application that has around 7 forms.
To move from one form to another I use "redirect".
I also use around 12 Session items that I fill with different values
like for ex.: Session.item("EmployeeName")="LILIA"
98% of the time everything is OK.
However once "in a blue moon" I find that the value in
Session.item("EmployeeName") is lost.
I am sure is not an expiration time since this happens after only a
couple of minutes.
Any help will be very much appreciated.

Thanks,

LilianaIf you are convinced that it isn't the timout its almost for sure that the
application gets restarted for some reason.
Causes are editing wec.config,gloval.asax,...

Cheers,
Tom Pester

> Hello everyone,
> I have a problem I have no idea why it happens.
> I have an ASP.NET application that has around 7 forms.
> To move from one form to another I use "redirect".
> I also use around 12 Session items that I fill with different values
> like for ex.: Session.item("EmployeeName")="LILIA"
> 98% of the time everything is OK.
> However once "in a blue moon" I find that the value in
> Session.item("EmployeeName") is lost.
> I am sure is not an expiration time since this happens after only a
> couple of minutes.
> Any help will be very much appreciated.
> Thanks,
> Liliana
You must be sure follow issues:
1.Would you modify your application's bin directory.
2.May be your aspnet_wp.exe(in window2000 or xp) was recycled.
--
Help you,Help me.

"LiliA" wrote:

> Hello everyone,
> I have a problem I have no idea why it happens.
> I have an ASP.NET application that has around 7 forms.
> To move from one form to another I use "redirect".
> I also use around 12 Session items that I fill with different values
> like for ex.: Session.item("EmployeeName")="LILIA"
> 98% of the time everything is OK.
> However once "in a blue moon" I find that the value in
> Session.item("EmployeeName") is lost.
> I am sure is not an expiration time since this happens after only a
> couple of minutes.
> Any help will be very much appreciated.
> Thanks,
> Liliana
>

Session Values and Javascript?

I have a javascript menu navigation. I have some session values which
regularly get updated, but when i navigate using this Javascript menu
to a different page i'm not able to see the updated session values
where I actually need them, i will be getting only the old ones. And
when i refresh the page i can see the new values.
Is there is way to get around this problem?
Can any one help please?I think what is more likely is that somehow the values are getting reset. It
doesn't matter if javascript or something else is doing the navigation - as
long as there is the same sessionid, you would see those values.

I would look at your code. My guess is that those values are getting reset
somehow to their 'old' values.

Also, I'm not sure what you mean by 'see' the new values. Are you displaying
these values on the page? Perhaps your pages are being cached by the browser
then.

If you are talking about on the server in the code, then I think it is the
case that something is resetting them.

"savvy" <johngera@.gmail.comwrote in message
news:1152624752.473102.120480@.p79g2000cwp.googlegr oups.com...

Quote:

Originally Posted by

>I have a javascript menu navigation. I have some session values which
regularly get updated, but when i navigate using this Javascript menu
to a different page i'm not able to see the updated session values
where I actually need them, i will be getting only the old ones. And
when i refresh the page i can see the new values.
Is there is way to get around this problem?
Can any one help please?
>


Can it be a caching issue? To rule it out, try adding a random query
parameter to the url you navigate to in javascript.
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]

"savvy" <johngera@.gmail.comwrote in message
news:1152624752.473102.120480@.p79g2000cwp.googlegr oups.com...

Quote:

Originally Posted by

>I have a javascript menu navigation. I have some session values which
regularly get updated, but when i navigate using this Javascript menu
to a different page i'm not able to see the updated session values
where I actually need them, i will be getting only the old ones. And
when i refresh the page i can see the new values.
Is there is way to get around this problem?
Can any one help please?
>


Did you checked whether the sessions values are updated with the new
values? Please confirm that before doing anything.

--
Vadivel Kumar
http://www.vadivelk.net
vadi@.online.vadivelk.net (remove "online.")

savvy wrote:

Quote:

Originally Posted by

I have a javascript menu navigation. I have some session values which
regularly get updated, but when i navigate using this Javascript menu
to a different page i'm not able to see the updated session values
where I actually need them, i will be getting only the old ones. And
when i refresh the page i can see the new values.
Is there is way to get around this problem?
Can any one help please?
>


Yes, I'm displaying the values on all the pages,Actually I'm developing
a shopping cart in which I'm displaying a small Item basket on all the
pages which displays number of Items added to the basket and their
total price on all pages.
So for example when I doing Response.Redirect to a Particular Page I
can see the updated values but when i navigate using this javascript
menu its just bringing up the old values ,
I can see that page is not posted back and I think its just bringing up
the cached page (I dont know much about caching! sorry). I think this
is pointing to the Caching Issue Problem
I'm not able to understand how to get over this problem. i've trying
this since 5 days till now
Thanks in advance for your time and help

code...

protected void Page_Load(object sender, EventArgs e)
{
if (Convert.ToString(Session["Total"]) == string.Empty)
{
pllogin.Visible = true;
plbasket.Visible = false;
}
else
{
pllogin.Visible = false;
plbasket.Visible = true;
lblquantity.Text = Convert.ToString(Session["TotQty"]);
lblprice.Text = Convert.ToString(Session["Total"]);
}
}
Thanks everyone for your time
Contd...
Yes, I can see the values are updated and they are not resetted. lets
say in the main basket page if i change the no of items(quantity) so
the total price gets changes as well and these updated values are
supposed to be seen in all pages but if I use the JS Menu and navigate
to a particular page I can see the previous values only and if I
refresh the same page i can see the updated values.
Hope i made myself clear
So, if this is a caching issue how can i update the values in the
cache?

Thanks in Advance

savvy wrote:

Quote:

Originally Posted by

Yes, I'm displaying the values on all the pages,Actually I'm developing
a shopping cart in which I'm displaying a small Item basket on all the
pages which displays number of Items added to the basket and their
total price on all pages.
So for example when I doing Response.Redirect to a Particular Page I
can see the updated values but when i navigate using this javascript
menu its just bringing up the old values ,
I can see that page is not posted back and I think its just bringing up
the cached page (I dont know much about caching! sorry). I think this
is pointing to the Caching Issue Problem
I'm not able to understand how to get over this problem. i've trying
this since 5 days till now
Thanks in advance for your time and help
>
code...
>
protected void Page_Load(object sender, EventArgs e)
{
if (Convert.ToString(Session["Total"]) == string.Empty)
{
pllogin.Visible = true;
plbasket.Visible = false;
}
else
{
pllogin.Visible = false;
plbasket.Visible = true;
lblquantity.Text = Convert.ToString(Session["TotQty"]);
lblprice.Text = Convert.ToString(Session["Total"]);
}
}


As I suggested in my other response, one of the ways to trick caching is to
add a random query parameter to the url. For example, instead of navigating
to abc.aspx, go to abc.aspx?<here is a random value>.

If you set url in javascript you can use the millisecond part of the current
time:
'abc.aspx?' + (new Date()).getMilliseconds()

If you set url on server side, you can use Random class or whatever else you
find for this matter.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]

"savvy" <johngera@.gmail.comwrote in message
news:1152629652.206523.186880@.m73g2000cwd.googlegr oups.com...

Quote:

Originally Posted by

Yes, I'm displaying the values on all the pages,Actually I'm developing
a shopping cart in which I'm displaying a small Item basket on all the
pages which displays number of Items added to the basket and their
total price on all pages.
So for example when I doing Response.Redirect to a Particular Page I
can see the updated values but when i navigate using this javascript
menu its just bringing up the old values ,
I can see that page is not posted back and I think its just bringing up
the cached page (I dont know much about caching! sorry). I think this
is pointing to the Caching Issue Problem
I'm not able to understand how to get over this problem. i've trying
this since 5 days till now
Thanks in advance for your time and help
>
code...
>
protected void Page_Load(object sender, EventArgs e)
{
if (Convert.ToString(Session["Total"]) == string.Empty)
{
pllogin.Visible = true;
plbasket.Visible = false;
}
else
{
pllogin.Visible = false;
plbasket.Visible = true;
lblquantity.Text = Convert.ToString(Session["TotQty"]);
lblprice.Text = Convert.ToString(Session["Total"]);
}
}
>


Eliyahu Goldin, I dont know how to convey my thanks to u
it worked perfectly mate, i've been struggling to solve this problem
I didn't have got this trick
Thank u very very much
I can only wish with all my heart for your success in what ever u do
mate
Thank u very much for your time
I can only wish with all my heart for your success in what ever u do

Thank you.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]

Session values across subdomains

Is it possible to keep sessions between subdomains?
I.e
If I have a site "shop.com" and when user acess his personal page it's
"secure.shop.com"
Is it possible to share the session values between these two?
Why I ask is because the hosting company gives a discount on SSL
certificates if I put it at secure.shop.com instead of the entire site
and since I only need checkout and personal info pages to be secure I
was thinking that I could put that info in the secure.shop.com domain
but I am worried I will loose session info like cartid, userid and
such..
Regards,
Danielit depends. to share the session cookie, you override the domain in the
session cookie, pretty simple. if secure.shop.com and shop.com are the
same site then you are done. if they are different sites and you use
inproc session, then you will need some way to pass session data from
one site to another (say a web service).
-- bruce (sqlwork.com)
daniel.westerberg@.ruilong.se wrote:
> Is it possible to keep sessions between subdomains?
> I.e
> If I have a site "shop.com" and when user acess his personal page it's
> "secure.shop.com"
> Is it possible to share the session values between these two?
> Why I ask is because the hosting company gives a discount on SSL
> certificates if I put it at secure.shop.com instead of the entire site
> and since I only need checkout and personal info pages to be secure I
> was thinking that I could put that info in the secure.shop.com domain
> but I am worried I will loose session info like cartid, userid and
> such..
> Regards,
> Daniel

Monday, March 26, 2012

session variable getting lost

There is a problem with losing values in Session Variable. I am
currently troubleshooting as to why. I am working with tabs and all
code is on the same page and my session variables are dropping.
Microsoft acknowledge this is a problem:
http://support.microsoft.com/kb/316148. I am still trying to figure out
why I am losing my session variables. None of the issues mentioned here
or on microsoft have been found to be the culprit.
If anyone knows why, I would like to know.
*** Sent via Developersdex http://www.examnotes.net ***That KB is over 2 years old.
Antivirus scans are but one of the possible reasons for applications to rest
art,
which in turn causes the loss of session variables if session state is kept
in-process.
Modifying the source code of your Web application will
cause ASP.NET to recompile source files into assemblies.
When you modify the top-level items in your application, all other assemblie
s
in the application that reference the top-level assemblies are recompiled as
well.
In addition, modifying, adding, or deleting certain types of files
within the application's known folders will cause the application to restart
.
The following actions will cause an application restart:
1. Adding, modifying, or deleting assemblies from the application's Bin fold
er.
2. Adding, modifying, or deleting localization resources
from the App_GlobalResources or App_LocalResources folders.
3. Adding, modifying, or deleting the application's Global.asax file.
4. Adding, modifying, or deleting source code files in the App_Code director
y.
5. Adding, modifying, or deleting Profile configuration.
6. Adding, modifying, or deleting Web service references in the App_WebRefer
ences directory.
7. Adding, modifying, or deleting the application's Web.config file.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
======================================
"Carlos Vasquez" <rvproductions2000@.gmail.com> wrote in message news:%23Kjld0MkIHA.6136@.TK2
MSFTNGP03.phx.gbl...
> There is a problem with losing values in Session Variable. I am
> currently troubleshooting as to why. I am working with tabs and all
> code is on the same page and my session variables are dropping.
> Microsoft acknowledge this is a problem:
> http://support.microsoft.com/kb/316148. I am still trying to figure out
> why I am losing my session variables. None of the issues mentioned here
> or on microsoft have been found to be the culprit.
> If anyone knows why, I would like to know.
> *** Sent via Developersdex http://www.examnotes.net ***

Saturday, March 24, 2012

Session Variable Values Across HTTP/HTTPS

It appears that I'm losing values for session variables when I move from a
page like http://www.my_site.com/catalog.aspx to
https://www50.ssldomain.com/my_site/login.aspx and vice versa.
Are session variables suppose to lose values across different domain names?
The www50.ssldomain.com is hosted by the same webhost. It's just how they
handle their SSL certificate.
Help! Thanks for any help.
KenAcross domains? Yes. What happens, client side, is there are two server
cookies sent. This is quite normal and part of the "security" built into
browsers.
If you have a persistant store (database, for example), store values in the
database. On the same machine, you can sometimes get away with equivalent
machine keys, but cross domain is still a difficulty. The persistant store
overcomes this, as you can look up values as a user moves from site to site.
This is best if you go to cookieless authentication (which munges in the
session key).
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
***************************
Think Outside the Box!
***************************
"MisterKen" wrote:

> It appears that I'm losing values for session variables when I move from a
> page like http://www.my_site.com/catalog.aspx to
> https://www50.ssldomain.com/my_site/login.aspx and vice versa.
> Are session variables suppose to lose values across different domain names
?
> The www50.ssldomain.com is hosted by the same webhost. It's just how they
> handle their SSL certificate.
> Help! Thanks for any help.
> Ken
Thanks for the clarification.
Do you know of a webpage that might demonstrate this?
"Cowboy (Gregory A. Beamer) - MVP" wrote:
> Across domains? Yes. What happens, client side, is there are two server
> cookies sent. This is quite normal and part of the "security" built into
> browsers.
> If you have a persistant store (database, for example), store values in th
e
> database. On the same machine, you can sometimes get away with equivalent
> machine keys, but cross domain is still a difficulty. The persistant store
> overcomes this, as you can look up values as a user moves from site to sit
e.
> This is best if you go to cookieless authentication (which munges in the
> session key).
>
> --
> Gregory A. Beamer
> MVP; MCP: +I, SE, SD, DBA
> ***************************
> Think Outside the Box!
> ***************************
>
> "MisterKen" wrote:
>

Session Variable Values Across HTTP/HTTPS

It appears that I'm losing values for session variables when I move from a
page like http://www.my_site.com/catalog.aspx to
https://www50.ssldomain.com/my_site/login.aspx and vice versa.

Are session variables suppose to lose values across different domain names?

The www50.ssldomain.com is hosted by the same webhost. It's just how they
handle their SSL certificate.

Help! Thanks for any help.

KenAcross domains? Yes. What happens, client side, is there are two server
cookies sent. This is quite normal and part of the "security" built into
browsers.

If you have a persistant store (database, for example), store values in the
database. On the same machine, you can sometimes get away with equivalent
machine keys, but cross domain is still a difficulty. The persistant store
overcomes this, as you can look up values as a user moves from site to site.
This is best if you go to cookieless authentication (which munges in the
session key).

--

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************

"MisterKen" wrote:

> It appears that I'm losing values for session variables when I move from a
> page like http://www.my_site.com/catalog.aspx to
> https://www50.ssldomain.com/my_site/login.aspx and vice versa.
> Are session variables suppose to lose values across different domain names?
> The www50.ssldomain.com is hosted by the same webhost. It's just how they
> handle their SSL certificate.
> Help! Thanks for any help.
> Ken
Thanks for the clarification.

Do you know of a webpage that might demonstrate this?

"Cowboy (Gregory A. Beamer) - MVP" wrote:

> Across domains? Yes. What happens, client side, is there are two server
> cookies sent. This is quite normal and part of the "security" built into
> browsers.
> If you have a persistant store (database, for example), store values in the
> database. On the same machine, you can sometimes get away with equivalent
> machine keys, but cross domain is still a difficulty. The persistant store
> overcomes this, as you can look up values as a user moves from site to site.
> This is best if you go to cookieless authentication (which munges in the
> session key).
>
> --
> Gregory A. Beamer
> MVP; MCP: +I, SE, SD, DBA
> ***************************
> Think Outside the Box!
> ***************************
>
> "MisterKen" wrote:
> > It appears that I'm losing values for session variables when I move from a
> > page like http://www.my_site.com/catalog.aspx to
> > https://www50.ssldomain.com/my_site/login.aspx and vice versa.
> > Are session variables suppose to lose values across different domain names?
> > The www50.ssldomain.com is hosted by the same webhost. It's just how they
> > handle their SSL certificate.
> > Help! Thanks for any help.
> > Ken

Session variable values being lost! Why?

I am running a site using ASP.NET and have discovered that values stored in session variables are being lost when moving from one page to another. I set the values on the first page and verify that the session variables are populated. Then, on another page, where my code needs to extract the values, the session variables have values of 'nothing'.

Has anyone encountered this and, if so, do you know how to fix it?Interesting...

Are you running ASP or ASPX pages?

Do you have session state enabled on the server?

Did it used to work?
I'm running ASPX pages. Session state is enabled. It works on my PC. I have other Websites on the same server and they work. In this application, I am using the following line in the Web.config file:

<identity impersonate = "true" />

The reason I'm playing with this is that I'm trying to set-up my application so that the Website runs on the Web server, but all the files that it accesses are on another server that is not exposed to the Web.
Dumb question but has to be asked: does your client allow cookies?

I don't see think the impersonation can be causing this. I'm doing the same thing as yourself and not having any problems.
Yes, the client allows cookies. If I put all of the files that the Website uses on the same server as the Website, there is no problem. However, I get this problem when I try to access files that are on another server using impersonation.

If I remove the following line...

<identity impersonate = "true" />

...and try to access the files on another server, I get the following message: "System.IO.IOException: Logon failure: unknown user name or bad password.". If I add the above line in, it still doesn't work properly. What happens then is that a dialog pops up asking me to log-in and, if I cancel, access to the other server is denied.

If I try the following line...

<identity impersonate="true" name="domain\user" password="something" />

...as it says can be used if you lookup "impersonation" in the help files, I get the following message: "Unrecognized attribute 'name'". I think the problem must be somehow related to authentication or the way I'm trying to use impersonation. Is there some other alternative way that I can go about doing this?
You're having a great day aren't you!

Your impersonate entry looks good to me.

Does your web.config authentication look like this:

<authentication mode="Windows" />
What are you doing for IIS authentication. You using Basic or Integrated? Definitely not Anonymous right?

I'm still amazed that this authentication issue is trashing your session variables.

What is your session state mode -- "InProc"?
Yes...what a wonderful day! Well, I appreciate that you're helping me out.

The authentication mode in Web.config is "Windows".

I had the authentication mode set to Integrated and now switched it to Basic. Since the site will have SSL, I guess Basic authentication should be okay to use. Now, when I go to the site, a login dialog appears. If I type in the user name and password, I get into the site and am able to access all of the files that are on the other server. I guess there must have been some problem with me using Integrated authentication.

My next question, then, is how to bypass the login dialog that appears when the user first navigates to the site. Can I add some code somewhere or change a setting to accomplish this?

If I use the following impersonate entry...

<identity impersonate="true" name="user" password="abc" />

...I still get the "Unrecognized attribute 'name'" error. Is there somewhere specifically within the web.config file that this line is supposed to appear?

The...

<identity impersonate="true" />

...line seems to be working now, since I am able to access the files on the other server from my Web application.
did you got the answer. I am getting same problem
No, I still haven't got a reply. I'm going to try assigning permissions to the IIS account on the other server and see if that will work using anonymous authentication.
it works fine if you use netscape's browser

Thursday, March 22, 2012

session variables

Hi all, I'm having a problem transferring session variable values between web forms. I'm storing them like so...

if intID <> 0 then
Session("EmployeeID") = intID
FormsAuthentication.RedirectFromLoginPage(intID, false)
Response.Redirect("Webform2.aspx")

I've checked and the value is being stored ok - it can be printed out on this form. However on my second form I have this...

txtID.Text = HttpContext.Current.Session("EmployeeID")

...but the value is not retrieved. I've tried it with cookies and with ViewState as well and can't get anything to pass the values over.
Any help much appreciated!Hmm, if no state saving mechanism (cookies, viewstate, session, etc) is holding a value, then I would say that there is a problem with the flow of how the code executes. Ie, you're requesting the value before it's been initialized. Perhaps posting the necessary code for both pages would help clarify the problem.
Hello, try to use

HttpContext.Current.Session("EmployeeID").ToString()

regards
I'm passing two strings (username, password) to a business object which returns an integer (employeeID). The following procedure is called when the user clicks a button to login. It is working fine and if I disable the link, put a textbox on the page and call the session variable, the value is there all right...


<%@. Import namespace="UserAuthentication" %>
<%@. Page Language="vb" EnableSessionState="True" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb" Inherits="InventoryManager.WebForm1"%>
<%@. Register TagPrefix="Inventory" TagName="Footer" src="http://pics.10026.com/?src=footer.ascx" %>
<%@. Register TagPrefix="Inventory" TagName="Header" src="http://pics.10026.com/?src=header.ascx" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>WebForm1</title>
<script runat="server"
sub Login(obj as object, e as EventArgs)

' UserAuthentication is the namespace name
' AuthenticateUser is the class inside it
dim objUser as New UserAuthentication.AuthenticateUser
dim intID as integer

' Login is a method of the AuthenticateUser class
intID = objUser.Login(txtUserName.Text, txtPassword.Text)

if intID <> 0 then

Session("EmployeeID") = intID
FormsAuthentication.RedirectFromLoginPage(intID, false)
Response.Redirect("Webform2.aspx")
else
lblMessage.Visible = True
lblMessage.Text="Invalid Login"
end if

end sub

</script>


Then on the page this redirects to...

Imports System.Web.Security ' Required Class for Authentication
Imports System.Data ' DB Accessing Import
Imports System.Data.OleDb ' Access Database Required Import
Imports System.Configuration ' Required for Web.Config appSettings
Imports System.Web

Public Class WebForm2

Inherits System.Web.UI.Page
Dim MyConn As OleDbConnection = New OleDbConnectio(ConfigurationSettings.AppSettings("strConn"))

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

If Not Page.IsPostBack Then

' Fill the Listbox with Product Items
ListLoad()
MyConn.Close()
txtID.Text = HttpContext.Current.Session("EmployeeID")
End If

txtID.Text = HttpContext.Current.Session("EmployeeID")

End Sub


But this doesn't retrieve the value.
OK haider, I'll try that this evening.
ok, please do test it and reply back to me, to follow up with you. there shouldn't be any problem.

regards
Sorry haider, that didn't work either.

Hello,

I am having similar problems. I store a value in a session variable from a textbox - Session("IDate") = textbox1.text

The value is in the session variable. I then call the new page with this Response.Redirect("Newpage.aspx")

On the new page I am trying to store the value into another text box, but no value is there. I can issue a Response.Writre(Session("IDate")) and the value is displayed. But if I use tbxStartDate.Text = Session("IDate").ToString() the value is not entered in the text box. Any suggestions?

Mike

Tuesday, March 13, 2012

Session Variables disappear

Hi NG,
I have a weird problem, that's starting to get my sanity.
My webapplication stores several values in Session["xxx"]. After a
server roundtrip, no Session variables exist anymore (Session.Count is 0)
I have logged the Session.SessionID, it is the same as before.
I have logged the last and the first line of code in my Codebehind. When
I leave the code the first time, I have a total number of 18 Session
Variables. When I enter the site again, I have 0 Session Variables.
The session timeout is 20 minutes and sessions are activates in IIS (6.0)
There is no Session.Abandon in the code.
The worst thing, I have a previous version of the webapp, which works
fine. From this version to the problematic one, I have just changed the
html-Code and added the use of the QueryString to initialize the app.
I even have uninstalled the .NET update, that hit us yesterday, cause
yesterday everything worked fine.
Not to mention, that I need to present the project next monday.
I have no ideas left anymore, if anyone could help me out, it would be
great.
Thanks in advance,
Frank"Frank Schumacher" <fs_nospam@.informatik.uni-leipzig.de> wrote in message
news:uDDknwEEFHA.2288@.TK2MSFTNGP14.phx.gbl...
> Hi NG,
> I have a weird problem, that's starting to get my sanity.
> My webapplication stores several values in Session["xxx"]. After a server
> roundtrip, no Session variables exist anymore (Session.Count is 0)
> I have logged the Session.SessionID, it is the same as before.
>
Every time any process touches the web.config, the application is restarted,
and all the sessions are killed. Make sure no other process (like a virus
scanner) is touching your web.config.
David
Hi David

>
> Every time any process touches the web.config, the application is restarte
d,
> and all the sessions are killed. Make sure no other process (like a virus
> scanner) is touching your web.config.
thanks for your reply. I have disabled the virus scanner, but the
problem persists.
I have checked the properties of the Web.config imediate after testing
the webapp and last access was 15 minutes before.
I use my Web.config to store some appSettings, but I only read them.
Thanks anyway,
Frank
How often is IIS recycling your app?
MattC
"Frank Schumacher" <fs_nospam@.informatik.uni-leipzig.de> wrote in message
news:%23k$Wz%23EEFHA.3728@.TK2MSFTNGP14.phx.gbl...
> Hi David
>
> thanks for your reply. I have disabled the virus scanner, but the problem
> persists.
> I have checked the properties of the Web.config imediate after testing the
> webapp and last access was 15 minutes before.
> I use my Web.config to store some appSettings, but I only read them.
> Thanks anyway,
> Frank
David,
re:
> Every time any process touches the web.config, the application is
> restarted, Make sure no other process (like a virus scanner) is touching
> your web.config.
A virus scanner does *not* "touch" a web.config
file in such a way as to change its file date,
which is the trigger for restarting applications.
Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Espaol
=====================
"David Browne" <davidbaxterbrowne no potted meat@.hotmail.com> wrote in
message news:%23p3EA4EEFHA.2572@.tk2msftngp13.phx.gbl...
> "Frank Schumacher" <fs_nospam@.informatik.uni-leipzig.de> wrote in message
> news:uDDknwEEFHA.2288@.TK2MSFTNGP14.phx.gbl...
> Every time any process touches the web.config, the application is
> restarted, and all the sessions are killed. Make sure no other process
> (like a virus scanner) is touching your web.config.
> David
Hi MattC,

> How often is IIS recycling your app?
I have checked the properties of the application pool in which my webapp
is running. Reuse is: workerprocess reuse in 1740 minutes.
I don't know, if I translate it correctly, cause I have a german version
of IIS.
Thanks,
Frank
> "Frank Schumacher" <fs_nospam@.informatik.uni-leipzig.de> wrote in message
> news:%23k$Wz%23EEFHA.3728@.TK2MSFTNGP14.phx.gbl...
>
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:%23oS6bJFEFHA.3944@.tk2msftngp13.phx.gbl...
> David,
> re:
> A virus scanner does *not* "touch" a web.config
> file in such a way as to change its file date,
> which is the trigger for restarting applications.
>
Some do. In particular some virus scanners use NTFS alternate file streams
to store information about the scan status of files. Writing data to an
alternate file stream generates the same file change notification as writing
to the primary stream. This causes ASP.NET to shut down the application.
David
heh, heh...
Please identify them...so I know
which virus scanners *not* to buy.
That's wicked behavior.
Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Espaol
=====================
"David Browne" <davidbaxterbrowne no potted meat@.hotmail.com> wrote in
message news:eI1eTdFEFHA.2568@.TK2MSFTNGP10.phx.gbl...
> "Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
> news:%23oS6bJFEFHA.3944@.tk2msftngp13.phx.gbl...
> Some do. In particular some virus scanners use NTFS alternate file
> streams to store information about the scan status of files. Writing data
> to an alternate file stream generates the same file change notification as
> writing to the primary stream. This causes ASP.NET to shut down the
> application.
> David

Session Variables disappear

Hi NG,

I have a weird problem, that's starting to get my sanity.

My webapplication stores several values in Session["xxx"]. After a
server roundtrip, no Session variables exist anymore (Session.Count is 0)

I have logged the Session.SessionID, it is the same as before.

I have logged the last and the first line of code in my Codebehind. When
I leave the code the first time, I have a total number of 18 Session
Variables. When I enter the site again, I have 0 Session Variables.

The session timeout is 20 minutes and sessions are activates in IIS (6.0)

There is no Session.Abandon in the code.

The worst thing, I have a previous version of the webapp, which works
fine. From this version to the problematic one, I have just changed the
html-Code and added the use of the QueryString to initialize the app.

I even have uninstalled the .NET update, that hit us yesterday, cause
yesterday everything worked fine.

Not to mention, that I need to present the project next monday.

I have no ideas left anymore, if anyone could help me out, it would be
great.

Thanks in advance,
Frank"Frank Schumacher" <fs_nospam@.informatik.uni-leipzig.de> wrote in message
news:uDDknwEEFHA.2288@.TK2MSFTNGP14.phx.gbl...
> Hi NG,
> I have a weird problem, that's starting to get my sanity.
> My webapplication stores several values in Session["xxx"]. After a server
> roundtrip, no Session variables exist anymore (Session.Count is 0)
> I have logged the Session.SessionID, it is the same as before.

Every time any process touches the web.config, the application is restarted,
and all the sessions are killed. Make sure no other process (like a virus
scanner) is touching your web.config.

David
Hi David

>>
>>I have a weird problem, that's starting to get my sanity.
>>
>>My webapplication stores several values in Session["xxx"]. After a server
>>roundtrip, no Session variables exist anymore (Session.Count is 0)
>>
>>I have logged the Session.SessionID, it is the same as before.
>>
>
> Every time any process touches the web.config, the application is restarted,
> and all the sessions are killed. Make sure no other process (like a virus
> scanner) is touching your web.config.

thanks for your reply. I have disabled the virus scanner, but the
problem persists.
I have checked the properties of the Web.config imediate after testing
the webapp and last access was 15 minutes before.
I use my Web.config to store some appSettings, but I only read them.

Thanks anyway,
Frank
How often is IIS recycling your app?

MattC

"Frank Schumacher" <fs_nospam@.informatik.uni-leipzig.de> wrote in message
news:%23k$Wz%23EEFHA.3728@.TK2MSFTNGP14.phx.gbl...
> Hi David
>>>
>>>I have a weird problem, that's starting to get my sanity.
>>>
>>>My webapplication stores several values in Session["xxx"]. After a server
>>>roundtrip, no Session variables exist anymore (Session.Count is 0)
>>>
>>>I have logged the Session.SessionID, it is the same as before.
>>>
>>
>>
>> Every time any process touches the web.config, the application is
>> restarted, and all the sessions are killed. Make sure no other process
>> (like a virus scanner) is touching your web.config.
> thanks for your reply. I have disabled the virus scanner, but the problem
> persists.
> I have checked the properties of the Web.config imediate after testing the
> webapp and last access was 15 minutes before.
> I use my Web.config to store some appSettings, but I only read them.
> Thanks anyway,
> Frank
David,

re:
> Every time any process touches the web.config, the application is
> restarted, Make sure no other process (like a virus scanner) is touching
> your web.config.

A virus scanner does *not* "touch" a web.config
file in such a way as to change its file date,
which is the trigger for restarting applications.

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Espaol
=====================

"David Browne" <davidbaxterbrowne no potted meat@.hotmail.com> wrote in
message news:%23p3EA4EEFHA.2572@.tk2msftngp13.phx.gbl...
> "Frank Schumacher" <fs_nospam@.informatik.uni-leipzig.de> wrote in message
> news:uDDknwEEFHA.2288@.TK2MSFTNGP14.phx.gbl...
>> Hi NG,
>>
>> I have a weird problem, that's starting to get my sanity.
>>
>> My webapplication stores several values in Session["xxx"]. After a server
>> roundtrip, no Session variables exist anymore (Session.Count is 0)
>>
>> I have logged the Session.SessionID, it is the same as before.
>
> Every time any process touches the web.config, the application is
> restarted, and all the sessions are killed. Make sure no other process
> (like a virus scanner) is touching your web.config.
> David
Hi MattC,

> How often is IIS recycling your app?

I have checked the properties of the application pool in which my webapp
is running. Reuse is: workerprocess reuse in 1740 minutes.

I don't know, if I translate it correctly, cause I have a german version
of IIS.

Thanks,
Frank

> "Frank Schumacher" <fs_nospam@.informatik.uni-leipzig.de> wrote in message
> news:%23k$Wz%23EEFHA.3728@.TK2MSFTNGP14.phx.gbl...
>>Hi David
>>
>>
>>>>I have a weird problem, that's starting to get my sanity.
>>>>
>>>>My webapplication stores several values in Session["xxx"]. After a server
>>>>roundtrip, no Session variables exist anymore (Session.Count is 0)
>>>>
>>>>I have logged the Session.SessionID, it is the same as before.
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:%23oS6bJFEFHA.3944@.tk2msftngp13.phx.gbl...
> David,
> re:
>> Every time any process touches the web.config, the application is
>> restarted, Make sure no other process (like a virus scanner) is touching
>> your web.config.
> A virus scanner does *not* "touch" a web.config
> file in such a way as to change its file date,
> which is the trigger for restarting applications.

Some do. In particular some virus scanners use NTFS alternate file streams
to store information about the scan status of files. Writing data to an
alternate file stream generates the same file change notification as writing
to the primary stream. This causes ASP.NET to shut down the application.

David
heh, heh...

Please identify them...so I know
which virus scanners *not* to buy.

That's wicked behavior.

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Espaol
=====================

"David Browne" <davidbaxterbrowne no potted meat@.hotmail.com> wrote in
message news:eI1eTdFEFHA.2568@.TK2MSFTNGP10.phx.gbl...
> "Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
> news:%23oS6bJFEFHA.3944@.tk2msftngp13.phx.gbl...
>> David,
>>
>> re:
>>> Every time any process touches the web.config, the application is
>>> restarted, Make sure no other process (like a virus scanner) is touching
>>> your web.config.
>>
>> A virus scanner does *not* "touch" a web.config
>> file in such a way as to change its file date,
>> which is the trigger for restarting applications.
>>
>>
> Some do. In particular some virus scanners use NTFS alternate file
> streams to store information about the scan status of files. Writing data
> to an alternate file stream generates the same file change notification as
> writing to the primary stream. This causes ASP.NET to shut down the
> application.
> David