I am developing an asp.net application in .net 3.5 where it redirect a user to paypal site after a successful registration a session value is stored in the form Session["UserId"].
After a succesful payment at paypal site and when the user returns to my site it gives I am trying to retrieve the session value like
ObjInvoice.Userid = Session["UserId"].ToString();
but it gives me a System.NullReferenceException, and it looks that Session["UserId"] is empty.
The application was working fine with all the browsers but when tested with IE8, fails frequently by showing the above error. Meanwhile I heard that IE8 has some issues in maintaing sessions during redirects
Please help me in this matter
Thanks in advance
Regards
Prabith
Session StateManage Statenull Session valuesession problemsession not setASP.NET State Managementasp.net. sessionssession and useridasp.net session timeoutasp.net.net session usageenablesessionstateasp.net 3.5accessing sessionC# and VB.net Session VariablesASP.NET_SessionIdASP.Net Session Management"ASP.Net State Service"ASP.NET sessionsSEEssion Managmentasp.NET 2.0 C# sessionSession object not working in subsequent pagessessionn variables
The application was working fine with all the browsers but when tested with IE8, fails frequently by showing the above error. Meanwhile I heard that IE8 has some issues in maintaing sessions during redirects
Only problem i know of with redirect is it ends the response. But it's not specific to IE8. You can fix it by using overloaded version of Redirect..
This is frustrating as so many people will be (or have already) upgraded to IE8 and now I have to tell my site's visitors that they need to adjust their security settings to a LOWER setting so they can view/interact with my site properly?
Firstly, I don't know many average Internet surfers that will be comfortable with setting the security settings in a browser, let alone convincing them that LOWERING them is what they need to do - I think most people would hear that and automatically knee-jerk
to think that that isn't such a great idea. And how could I blame them for thinking that?
/rant
My problem:
I have a shopping cart that redirects to paypal for payment finalization. Paypal (as you may already be famililar with) has a 'return' and 'cancel_return' URL parameter you can set to it. If the payment gets canceled on Paypal's side, I'd like to use the
'cancel_return' parameter to return my client to CanceledPayment.aspx and use a session variable to look up their order and finalize the canceling of the order (i.e., put the product back on the shelf and make it available to others to purchase). My products
in my store are unique, so when a user places it in their cart, I change the ProductStatus from 'Available' to 'Pending Purchase', and if the sale is successful, Paypal will return my client to ThankYou.aspx where I then want to use that same session variable
to change the ProductStatus to 'Item Sold' and then record their purchase history in their account and also allow them the opportunity to download a .pdf relevant to their product they purchased.
Now, I've thought of using Paypal's 'cancel_return' URL to pass a string like this: 'http://<site.com>/CanceledPayment.aspx&GUID=someKindOfVariableThatICouldReadInPlaceOfASessionVar' but apparently the Paypal 'cancel_return' parameter doesn't like to see
querystrings on those; it fails to process the payment.
So, because "IE8 blocks crossdomain cookies by default (from Paypal it’s cross domain)", I'm not sure where to go now as most general users update their systems and probably don't even know if they're using IE8 or 7.
Rather than depending on the session, keep those variables in database or xml file and use it after paypal payment.
I solved the problem in that way, stored those variables in XML and sent the session information to paypal using the "custom" field and used it after a succesful payment/cancel payment
prabith
Member
75 Points
21 Posts
Session Issue in Internet explorer 8
Nov 25, 2009 12:47 AM|LINK
Hi,
I am developing an asp.net application in .net 3.5 where it redirect a user to paypal site after a successful registration a session value is stored in the form Session["UserId"]. After a succesful payment at paypal site and when the user returns to my site it gives I am trying to retrieve the session value like
ObjInvoice.Userid = Session["UserId"].ToString();
but it gives me a System.NullReferenceException, and it looks that Session["UserId"] is empty.
The application was working fine with all the browsers but when tested with IE8, fails frequently by showing the above error. Meanwhile I heard that IE8 has some issues in maintaing sessions during redirects
Please help me in this matter
Thanks in advance
Regards
Prabith
Session State Manage State null Session value session problem session not set ASP.NET State Management asp.net. sessions session and userid asp.net session timeout asp.net.net session usage enablesessionstate asp.net 3.5 accessing session C# and VB.net Session Variables ASP.NET_SessionId ASP.Net Session Management "ASP.Net State Service" ASP.NET sessions SEEssion Managment asp.NET 2.0 C# session Session object not working in subsequent pages sessionn variables
budugu
All-Star
41122 Points
6021 Posts
Re: Session Issue in Internet explorer 8
Nov 25, 2009 02:44 AM|LINK
Only problem i know of with redirect is it ends the response. But it's not specific to IE8. You can fix it by using overloaded version of Redirect..
Response.Redirect("~/default.aspx", false);
Refer this..http://weblogs.asp.net/bleroy/archive/2004/08/03/207486.aspx
And by default session uses cookies to store sessionID's. Check if cookies are enabled on IE8 or not ?
"Don't be afraid to be wrong; otherwise you'll never be right."
prabith
Member
75 Points
21 Posts
Re: Session Issue in Internet explorer 8
Nov 25, 2009 03:13 AM|LINK
Thanks for the reply
I am using the overloaded method only. I mean with a false attibute to Response.Redirect.
Regards
Prabith
budugu
All-Star
41122 Points
6021 Posts
Re: Session Issue in Internet explorer 8
Nov 25, 2009 03:29 AM|LINK
What abt the cookie settings?
"Don't be afraid to be wrong; otherwise you'll never be right."
prabith
Member
75 Points
21 Posts
Re: Session Issue in Internet explorer 8
Nov 25, 2009 07:52 AM|LINK
Cookies are enabled. Still the issue remains
sandy060583
Star
8714 Points
1624 Posts
Re: Session Issue in Internet explorer 8
Nov 25, 2009 08:49 AM|LINK
try this step :
Here you need to set your security level low in IE8.
1. go to tools menu --> internet options
2. on security teb --> security zone --> set it to medium..
this is the problem of security setting only..
please read this : http://codeigniter.com/forums/viewthread/121637/
this will help to sort out yr problem..
Ramani Sandeep (My Blog)
(MCTS, MCC-2011)
isheahan
Member
230 Points
136 Posts
Re: Session Issue in Internet explorer 8
Dec 10, 2009 12:59 PM|LINK
This is frustrating as so many people will be (or have already) upgraded to IE8 and now I have to tell my site's visitors that they need to adjust their security settings to a LOWER setting so they can view/interact with my site properly?
Firstly, I don't know many average Internet surfers that will be comfortable with setting the security settings in a browser, let alone convincing them that LOWERING them is what they need to do - I think most people would hear that and automatically knee-jerk to think that that isn't such a great idea. And how could I blame them for thinking that?
/rant
My problem:
I have a shopping cart that redirects to paypal for payment finalization. Paypal (as you may already be famililar with) has a 'return' and 'cancel_return' URL parameter you can set to it. If the payment gets canceled on Paypal's side, I'd like to use the 'cancel_return' parameter to return my client to CanceledPayment.aspx and use a session variable to look up their order and finalize the canceling of the order (i.e., put the product back on the shelf and make it available to others to purchase). My products in my store are unique, so when a user places it in their cart, I change the ProductStatus from 'Available' to 'Pending Purchase', and if the sale is successful, Paypal will return my client to ThankYou.aspx where I then want to use that same session variable to change the ProductStatus to 'Item Sold' and then record their purchase history in their account and also allow them the opportunity to download a .pdf relevant to their product they purchased.
Now, I've thought of using Paypal's 'cancel_return' URL to pass a string like this: 'http://<site.com>/CanceledPayment.aspx&GUID=someKindOfVariableThatICouldReadInPlaceOfASessionVar' but apparently the Paypal 'cancel_return' parameter doesn't like to see querystrings on those; it fails to process the payment.
So, because "IE8 blocks crossdomain cookies by default (from Paypal it’s cross domain)", I'm not sure where to go now as most general users update their systems and probably don't even know if they're using IE8 or 7.
Any help or suggestions?
isheahan
Member
230 Points
136 Posts
Re: Session Issue in Internet explorer 8
Dec 10, 2009 01:01 PM|LINK
.
prabith
Member
75 Points
21 Posts
Re: Session Issue in Internet explorer 8
Dec 11, 2009 03:06 AM|LINK
Rather than depending on the session, keep those variables in database or xml file and use it after paypal payment.
I solved the problem in that way, stored those variables in XML and sent the session information to paypal using the "custom" field and used it after a succesful payment/cancel payment
~Regards
Prabith