After a looong night managed to change Session mode from inProc to SQLServer but still can't get the session variables to be saved

Hi,
 I ran my Shopping Cart project and somehow everything worked fine(while in inProc), session variables were saved fine. I made some changes to my project and since then keep getting null session variables, no matter what I do. It took me the whole night to figure out how to turn to SQLServer mode,  marked custom classes as 'Serializable' with [Serializable] before the class definition but everything's in vain. Getting the same damned 'nulls' instead of the saved objects.


private void Page_Load(object sender, System.EventArgs e)
        {
           
            lblEmptyCart.Visible = false;
            if ((Session["cart"]==null))
            {
                Session["cart"] = myCart;
            }
            else
            {
                myCart = (Cart)(Session["cart"]);
            }

..
..
When products page is loaded and an 'add' button is clicked on some product, I create a row with the necessary deyails for the product and then

myCart.list.Add(row);

I can see in the debugger that myCart..list.Count is changed to 1, therefore the object in the Session hastable should also be so, I suppose,
but when the products page i reloaded and I get to the code above  if ((Session["cart"]==null)) always succeeds and I end up with only one product in the cart,
no matter how many where clicked, since the cart info is not stored.

sitting on this for hours with no result, if someone could provide any helping tip I would be very grateful. Thanks so much.

Joseph




0
tsitsu
8/5/2005 4:24:37 AM
asp.net.state-management 8807 articles. 0 followers. Follow

3 Replies
991 Views

Similar Articles

[PageSpeed] 15

Can you just check the EnableSessionState property of the page. It needs to be set to True.
Regards

Dave
0
DMW
8/5/2005 9:22:11 AM
Thanks for answering , I checked every page that the project uses and
the default is 'enableSessionState = true' for every page. Maybe there
is something else I'm missing, any other setting to enable or..
anything. If  I  need to post some code please tell me, there
is just to much of it. Thanks again for your quick reply.
0
tsitsu
8/5/2005 12:16:50 PM
OK, thanks, I solved the problem finally, I changed 'cookieless' to "true" and it works.

<sessionState
            mode="SQLServer"
            stateConnectionString="tcpip=127.0.0.1:42424"
            sqlConnectionString="user id=sa;password=;server=127.0.0.1;"
            cookieless="true"
            timeout="20"
    />
0
tsitsu
8/5/2005 2:41:47 PM
Reply:

Similar Artilces:

Unable to serialize the session state. Please note that non-serializable objects or MarshalByRef objects are not permitted when session state mode is 'StateServer' or 'SQLServer'
 Hi,We are trying to implement Network loading for our asp.net (1.1) application for which we are storing the session in State Server.Following is the error is thrown while page is rendered when ever is a DTO is stored in to SEssion in any of the page.Unable to serialize the session state. Please note that non-serializable objects or MarshalByRef objects are not permitted when session state mode is 'StateServer' or 'SQLServer' Following the code I written for DTO (C# Asp.net 1.1).     using System;    using System.Runtime.Serializa...

I can't get no cache, I can't get no cache. 'Cause I try and I try and I try and, I can't get no, I can't get no cache.
I have fiddled out for days tinkering with the setting in about:config trying to get FireFox 12 to use the disk cache. I have NOT found the trick. This One Trick Pony ain't doing it like it used to up until recently. Pray tell anyone, What information can I share that will point a knowledgeable person to aid me in getting FF to disk.cache? I have also tried restarting FF with add-ons disabled, (There were NOT too many to do this to, so it was quick and easy) Here is my stab at trying to convey the information that MIGHT govern matters Using about:cache Informatio...

Re: I can't get no cache, I can't get no cache. ' Cause I try and I try and I try and, I can't get no, I can't get no cache.
<div>please com e see me about htis<br /> <br /> ------- Original Message f= rom the Global Relay Archive -------<br /> From: Hp &lt;ferd@farkel.net&gt;= <br /> To: "support-firefox@lists.mozilla.org" &lt;support-firefox@lists.mo= zilla.org&gt;<br /> Sent: Sun, 27 May 2012 18:30:18 -0700<br /> Subject: I = can't get no cache, I can't get no cache. 'Cause I try and I try and I try = and, I can't get no, I can't get no cache.<br /> <br /></div> <pre class=3D"gr-maex-body-pre&qu...

Can't get a new Session Variable to pass into a method (used Session, TextField and QueryString)
Hi Everyone,  I have been battling with this for about 18 hours now and coudl use some help...  I have a form that inserts into a DB table and then calls a method that makes a query to another table to create a Dataset for insert into a third table. ( I haven't done the third table insert yet but first things first.) Step 1 works fine. Step two is the problem. When I call the method I pass in two variables to get  return it will only work if I call an OLD Session variable. The session vaiable i set in the onSelectedChange event won't pass into the parameters... I als...

Can't get session variable...
Hello again!I've been trying to put up a shopping cart with a items list page and a second one (cart). When I hit the "buy" button from one item I get this error on "cart.aspx":"Object reference not set to an instance of an object" Line 5: Dim ds as DataSet Line 6: ds = CType(Session("myDataSet"), Dataset) Line 7: MyDataGrid.Datasource=ds.Tables("Catalogo").DefaultView Line 8: MyDataGrid.DataBind() Line 9: End Sub I have no clu where the error may come from so I'm gonna post both entire files code.item list.aspx ...

State management upon session variable changes
I noticed that whenever a session variable is changed...the application knows about it and suddenly restarts session. My question is does restart "ALL" sessions or only the active sessions for which the variables changed? Imagine a "multi-user" application all with different states and an administration panel that lets you change session variables.  In this case, my question has to do with the question that if Company X changes his session variables, will only Company X's sessions be reset or will all "sessions" be reset?  Hope that makes sense. ...

Unable to serialize the session state. In 'StateServer' and 'SQLServer' mode.
Hi Every one,First of all thank you everyone.Please help me to figure out this problem. I am building shopping cart in my global.asax (snippet),   <script runat="server">    void Application_Start(object sender, EventArgs e)     {        Application.Clear();     }        void Application_End(object sender, EventArgs e)     {        Application.Clear();        Session.Ab...

Unable to serialize the session state. In 'StateServer' and 'SQLServer' mode
i got this error... anyone encountered this yet? Server Error in '/MainLogin' Application. Unable to serialize the session state. In 'StateServer' and 'SQLServer' mode, ASP.NET will serialize the session state objects, and as a result non-serializable objects or MarshalByRef objects are not permitted. The same restriction applies if similar serialization is done by the custom session state store in 'Custom' mode. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for mor...

Unable to serialize the session state. In 'StateServer' and 'SQLServer' mode...
 Dear Fellows, I am having a problem in my asp.net applicationi made a online testing system, This system is running Fine on my local VS and also in local IIS (While Using Web MS SQL Server)But when I host this web site it gives me the error when i try to add an object in session[] Error Is - SETS is the name of my visual Directory Server Error in '/sets' Application.Unable to serialize the session state. In 'StateServer' and 'SQLServer' mode, ASP.NET will serialize the session state objects, and as a result non-serializable objects or MarshalByRef ob...

Two things,Why do I keep getting emails that I don't want. can't get rid of them? Why can't I get my email when I am out of town? Or can I?
Name: Ed Leech Email: ELCraftatzoominternetdotnet Product: Thunderbird Summary: Two things,Why do I keep getting emails that I don't want. can't get rid of them? Why can't I get my email when I am out of town? Or can I? Comments: I am getting frusted with all the emails coming in that I do not want, I am using the tools to get thme out but they keep coming. They just use different names or whatever. I have been thinking of just switching to something else but my business intrusts know this email and it is tooo confusing to change. Every time I go out of town on bu...

Can't shutdown after configuring the session manager
I use: OpenSuse 11.1 with KDE. I wish: no session restoring on login and no confirmation dialog on logout � i.e. OpenSuse should never ask me, if I click on �shutdown� and always start with new session. I do: So, in �System Settings� -> �Advanced�-Tab -> �Session Manager� I choose follow options: General: NO Confirm Logout NO Offer shutdown option On Login: YES Start with an empty session Default shutdown option: YES Turn off computer (finally, it goes disabled) The problem is: Now I can't shutdown my computer by clicking the �Shutdown� in main menu. ...

Can't save the value in HttpContext.Current.Session state
Hello,I have a class file (class1.cs) and I'm trying to put the variable in the HttpContext.Current.Session so I can access it in another class file (class2.cs) but get an error: "Object reference not set to an instance of an object".  Does anyone knows why and how do I solve it?  Thanks in advance. class1.cs HttpContext.Current.Session.Add("ReportName", ReportName);    //Error: Object reference not set to an instance of an object.   It seems that the Httpcontext is not avalible from where you are trying to access it. ...

How to change Jaguar settings if you can't get into Jaguar Manager
So Jaguar is getting messed up because of the bad messaging configuration. So I go into Jaguar manager and It tells me it is in admin mode. Catch -22 - I can't get into Jaguar manager until I remove the messaging service... and I can't remove the messaging service until I start Jagauar Manager. Is there some props file I may edit to remove the MessageService from the services parameter without going into JagManager?? in jaguar.props under ${jaguar}/Repository/Server, there is a property like com.sybase.jagaur.services with a comma-delimited list of services that load a...

Disabled XFCE Session Manager, now can't login to XFCE
I disabled the XFCE Session Manager when I last logged into XFCE, as it used to prompt for a new session to be named every time I logged into XFCE. Now, I cannot login to XFCE. On trying to Login, the splash screen (with the mouse graphic) appears and then the desktop and panel appear very briefly (3-4 secs), and replaced by a blank black screen. What can I do to re-enable 'Session Manager' ? I can boot via a 'Live CD' and make any necessary changes to system file(s)-but I don't know what XFCE file to alter ? -- Registered Linux User # 483705 (openSUSE 11...

Web resources about - After a looong night managed to change Session mode from inProc to SQLServer but still can't get the session variables to be saved - asp.net.state-management

rails-sqlserver (Rails SQL Server) · GitHub
rails-sqlserver has 4 repositories written in Ruby, JavaScript, and C. Follow their code on GitHub.

Tallan - LinkedIn
Welcome to the company profile of Tallan on LinkedIn. Founded in 1985, Tallan is a national IT consulting company that provides custom application... ...

Kazuhiko Kikuchi (@kazuk) on Twitter
Sign in Sign up To bring you Twitter, we and our partners use cookies on our and other websites. Cookies help personalize Twitter content, tailor ...

The Fantastic 12 of SQL Server 2012: Behind the Scenes - YouTube
... http://bit.ly/12of12pdf For more information on SQL Server 2012 and to download the trial version, please visit: http://www.microsoft.com/sqlserver ...

CamelCase - Wikipedia, the free encyclopedia
is the practice of writing compound words or phrases in which the elements are joined without spaces , with each element's initial letter capitalized ...

SQLUG.be
... that brings together the Belgian MS SQL Server community. Our goal is to share experiences, enthusiasm and knowledge about Microsoft SQLServer. ...

wangming7的日志 - 网易博客
wangming7的日志,小偷公司敬上,青年男女抿着嘴爆笑囧事,这个飞机可不是那个飞机噢!,潘基文与“鸟叔”朴载相 共跳“骑马舞”(图),看守泰坦尼克2B男青年大喊让妇女孩子先走,青年男女抿着嘴爆笑囧事,给鱼缸灌开水的后果,女流氓语录精选版,校园爆笑糗事大全,学普通话很重要噢!- ...

Expanding the Cloud for Windows Developers
The software that powers today’s world of Internet services has become incredibly diverse. Today’s announcement of Amazon RDS for Microsoft SQL ...

IT Developer/Engineer
... jobs at Monster. 15 or more years of experience writing code (such as, and not limited to, Java, C, C++, C#, VB.Net; databases like SqlServer/ ...

Cisco Technical Forums
Find ANY word Find ALL words Find EXACT phrase Help Aironet Power Supplies VoIP Gateways Cisco Repair Refurbished Cisco Cisco CPQRGs New ...

Resources last updated: 1/15/2016 4:28:59 AM