State Management :: How To Use Cookieless Session
Aug 28, 2010I want to know how its work and it advantage and disadvantege
View 2 RepliesI want to know how its work and it advantage and disadvantege
View 2 RepliesHow do you generate a URL for that uses cookieless sessions?
Neither Request.RawURL or Request.URL has the rewritten version that includes the sessionid.
In ASP.NET, I'm a bit confused about role of cookies in session state. Whats is the difference between normal session state and cookieless session state?
View 5 RepliesI've been working on this problem for some time without success. We have this website that has been working for many years now and we have been using cookieless sessions since the begining. Now we are integrating with another site to handle payment throught redirection. This provider ask for two adresses for success or failure of a payment so we have something like [URL] and [URL]. For design purpose thoses two pages do not exists and I use an httpModule to route to the proper page. I use httpApplication.Context.RewritePath to send to the proper page but I can never find back the session my user had before redirecting to the payment provider.
If I change the session mecanism to use cookies (cookieless="false" or cookieless="UseUri") with a few other tweaks, everything works fine Does anybody know if this has a chance to work? Is there a way to re-attach to an existing session?
I have an uploadify control working fine in a vb.net web application - however whenever I switch on cookieless session state in web.config (cookieless="true") - it stops working.
In my upload IHttpHandler I can see that the data stored by uploadify is nothing:
Private Function Process(ByVal context As HttpContext) As String
Dim File As HttpPostedFile
File = context.Request.Files("filedata") ' Nothing
Dim FileExt As String = context.Request("fileExt") ' Nothing, etc
...
I have an ASP .NET website that uses cookieless sessions When the initial request is made to the site IE just displays the standard "Internet Explorer cannot display the webpage" message Firefox displays the following message: The page isn't redirecting properly Firefox has detected that the server is redirecting the request for this address in a way that will never complete. *This problem can sometimes be caused by disabling or refusing to accept cookies. The site works fine with my development server and under IIS6. If I switch off cookieless sessions then everything is fine
View 3 RepliesI read the solutioin for this error, at the following link :http://forums.asp.net/p/1046935/1576341.aspxbut I am still not clear what exactly causes the error. I have two doubts :1. Can anyone please elaborate a bit on this issue, with any example ????2. Is there any drawback of this approach ?
View 4 RepliesCustomer were getting "View State Validation Error" due to worker process recycling at our production webserver and to fix that i applied machinekey and then move my Session state Mode from In Proc to State Server to retain session data and not kick out the customer to relogin. I had serialization issue with one object which has to be stored in session but when i moved it out of session i could able to resolve the issue.
But doing all these i was partly successfull in keeping the user in their session when Worker Process recycle event occurs.I was able to refresh the page or make a post back by clicking the refresh button and also able to retain the session values. But the Problem occurs when sending asynchronous request to server which we do periodically every 15 minutes from the moment the user logs in.The web page doesnot update data on website when sending asynchronous request.By Debugging I found at this particular code point it fails to make a postback which is required.
<%=GetHintFromServer%> (When there is no Worker Process recycle i t gets replaced by
WebForm_DoCallback('__Page',message,ShowHint,null,null,false) on postback) Everything works fine when there is no Worker Process Recyling but when it happens looks like sending request asynchronously using javascript fails .Remember When I make a post back by manually clicking submit button everything works fine.
SendRequest(Asynchronous)
function SendRequest(msg, isBusy, chartMsg, vesselMsg)
{
try
{
//confirm("msg"+msg+"isBusy"+isBusy+"chartMsg"+chartMsg+"VesselMsg"+vesselMsg);
_busy = isBusy;
if(chartMsg != null)
{
//confirm("chartMsg"+chartMsg);
_element.SetMessage(true, chartMsg);
}
if(vesselMsg != null)
{
confirm("chartMsg"+vesselMsg);
_element.ShowVesselLoading(true, vesselMsg);
}
_stuckWatchdog = setTimeout( "ClearPendingRequest();", 60000);
var message = msg;
var context = '';
<%=GetHintFromServer%>
}
catch(e)
{
alert( "Exception error on SendRequest(): " + e);
}
}
I am new to .net 4.0 and am using EF Model and SessionState Mode=SqlServer and I am getting this error below:
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.
I checked the stack trace and its complaining about
[assembly: global::System.Data.Objects.DataClasses.EdmSchemaAttribute()]
[assembly: global::System.Data.Objects.DataClasses.EdmRelationshipAttribute("PoplarGroveModel", "tblMenuRole", "tblMenu", global::System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(PoplarGroveDataModel.Menu), "tblRole",
[Code].....
I marked it as serializable but then it complains about System.Data.Objects.ObjectContext is not marked as serializable and hence throws the same error.
Our ASP.NET App uses ASP State Session Management and has been rebuilt about 2 years ago [With .NET Framework 2.0]. We are currently in .NET framework 3.5 and have moved to SQL Server 2008 - but continue to use the same ASPState database. The State database has been upgraded to SQL Server 2008. Since then we have are seeing timouts/locks on ASPStateTempSessions table. I am wondering if we have to rebuild this database from scratch with some newer scripts?
View 2 RepliesI'm using the following line of code to display the number of users currently logged on:
lblNoOfUsers.Text = Membership.GetNumberOfUsersOnline().ToString()
I'm still debugging my application so it's on the local server. As I debug and stop then debug again, eventually lblNoOfUsers.text turns to "0" instead of "1", even as I'm navigating my application. It only turns to "1" again if I log out and sign back in. It's almost as though Membership.GetNumberOfUsersOnline my login are referencing two different session states. How is this possible? Does asp.net create a new session state cookie each time I start debugging?
I am trying to set a session variable in the global.asax file and keep running into the problem that the Session is null.
I am running my application in VS2008 and using asp.net 3.51.
Here is my code:
1. In my web.config file I have enabled the session state and added the following line;
<sessionState
cookieless="false"
mode="InProc"
timeout="60"
></sessionState>
2. In the Session_Start procedure in the Global.asax file I set the session variable to a default value.
[Code]....
My problem seems to be that when the Application_Error procedure is executed the session state is lost.
Does anyone know why the session state isn't available in the Global.asax file.
All we have a global ships position tracking website which runs smoothly until IIS application pool recycles.When there is workerprocess recycling looks like session state expires as a result i loose all session data and when customer clicks refresh button he is redirected to login page.
In web.config Session state mode is set to InProc so i changed it to State Server but to my luck i have MAP object which is not serialiazable which is causing the maps from not appearing on the website.I tried adding serializable attribute to the object class but still not succesfull.Our website is accessed by our customers whose count is more than 1000.
Changing the session state mode from InProc to StateServer can really slow down the response time so
Is it good to go further fix the serailizable issues and move to state server?.
Is there any way I can retain my session data when application pool recyles?..
Stopping Application pool from recycling may not be a good idea considering health factor of web server.
I have a clear button and a textbox in an aspx page. I set the session variable in this page as
String str = Textbox1.Text;
Session["TypeIds"] = str;
and I clear the sessions in a clear button event as
Session["TypeIds"]=null;.
Then when the user types some value in the textbox ,on Response.Redirect on another aspx page, the session variable returns null values.It does not retain its session state. The session state has to be maintained in the next page. Is it because this clear button event and setting explicitly to null creates this problem?
The fix for this error message is to run [Code]..... I have run that uptown, downtown and in my lady's chamber and it does no good, although it never complains. Are there any other possibilities?Details:
IIS Server: v5.1 running on XP. SQLServer 2005 running on a different XP box.Microsoft .NET Framework Version:2.0.50727.3615; ASP.NET Version:2.0.50727.3618 There is an ASPState database on the server, containing only two tables: [Code].... and [Code]..... I did not use [Code].... when I ran [Code]....
.
I am building a web app that is limited to one database, therefore I cannot use the ASP.NET config tool. As a quick means of getting this app online, I tried to use a simple session variable. The login page verifies the user's credentials, and if they pass, it sets the session variable to a certain value. All other pages check in the page_load event whether or not the session variable is equal to that value. The problem is that once being logged in for a short while and sending and recieving some data, the session variable resets, and I'm returned to the login page to repeat the process. Here's the basic code from my webforms:
[code]....
Is there some setting I need to change in the web.config file to adjust the cookie timeout or is that only for the config tool authentication methods?
Just wanted to know in which type of web applications we can use or its good to use the out proc (SQL Server, State Server) session mode?
View 4 RepliesI write a simple web site in asp.net. In one page i want to delete a folder of web root. When i delete it folder, the all session in project is changed to null. I write a post in this forum. Here is the adress of it post: ([URL]) Some pepole answer me to change the session state mode to StateServer. In default the session state mode is Inproc, and i changed the session state mode to stateServer.but when i changed the session to stateserver this error is appear in application eventlog after two day and my web site dont working in iis. This error is like this:
Event Type:
Warning
Event Source:
ASP.NET 2.0.50727.0
Event Category:
Web Event
Event ID:
1310
Date:
3/12/2011
Time:
1:27:55 PM
User:
N/A
Computer:
WIN2003-00A346F
Description:
Event code: 3009
Event message: Unable to make the session state request to the session state server. Details: last phase='Sending request to the state
server', error code=0x80072749, size of outgoing data=0
Event time: 3/12/2011 1:27:55 PM
Event time (UTC): 3/12/2011 8:57:55 AM
Event ID: a5c8bfd16f74429e820989e8ce8082d0
Event sequence: 10
Event occurrence: 1
Event detail code: 50016
Application information:
Application domain: /LM/W3SVC/1547208020/Root-1-129443938731955000
Trust level: Full
Application Virtual Path: /
Application Path: C:InetpubwwwrootClishareClishare
Machine name: WIN2003-00A346F
Process information:
Process ID: 1276
Process name: aspnet_wp.exe
Account name: WIN2003-00A346FASPNET
Exception information:
Exception type: HttpException
Exception message: Unable to make the session state request to the session state server. Please ensure that the ASP.NET State service is started and that the client and server ports are the same. If the server is on a remote machine, please ensure that it accepts remote requests by checking the value of HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesaspnet_stateParametersAllowRemoteConnection. If the server is on the local machine, and if the before mentioned registry value does not exist or is set to 0, then the state server connection string must use either 'localhost' or '127.0.0.1' as the server name.
Request information:
Request URL: [URL]
Request path: /main/home.aspx
User host address: 64.79.69.155
User:
Is authenticated: False
Authentication Type:
Thread account name: WIN2003-00A346FASPNET
Thread information:
Thread ID: 1
Thread account name: WIN2003-00A346FASPNET
Is impersonating: False
Stack trace: Custom event details: For more information, see Help and Support Center at [URL]. When i reset ASP.NET State service, the problem is fixed, but after one or two days, this problem apears again. What's the problem and how can i fix it? And how can i delete a folder in asp.net without the session is lost?
We have a web site that implements a custom SiteMapProvider using a User Control added in the master page. I need to be able to limit the sitemap nodes added depending on the logged in user, that is, certain users should not see certain sitemap nodes. Currently, the login processing code determines if users are in the certain category or role and then sets a value in session state, for example, Session["UserInRoleXXX"] = "Yes"; I tried changing the code in the user control to check the session state, but I got the following error: NullReferenceException ... Object reference not set to an instance of an object." Can session state be accessed in a user control?
View 6 RepliesOur Web Server rebooted due to power failure. Now ASP.Net State service would not start logging the following error on the server:
Unable to make the Session State Request to the session state server. Last known phase=Sending request to the state server
how to bring back the ASP.Net State service.
I am getting this error "The session state information is invalid and might be corrupted " as i hve checked all my session variable initialized with some default value and the existing code works fine in version 1.1 but on conversion it is giving specified error. The error comes when i simply click on a link to redirect to some other page.
View 5 RepliesI created a form where I put some radio buttons. When User select one of them depending upon the option it will start his / her time counter. StartTime and EndTime and I am couting total time he/she takes. Till here it is OK. But what I want when user clicks on Logout, then he/she will logged out (Temporary). and after the some time when he / she will again login..... here, I want to set his / her EndTiming. I don't understand how to maintain this state?
View 5 RepliesI'm not sure if this is an error or is the right work mode for sql sessions.
I'm working now with Windows 2008 R2 Web Ed. and SQL Server 2008 Web Ed.
When I close my browse and open again a new browser window I need to login again in asp.net application and a new session is created in the sessions table in sql server.
It's this normal? I remember that with Windows 2003 and SQL 2005 this doesn't happend. When I closed my browser and open inmediately a new browser window my session was retained and I could continue working without relogin.
I have upgraded our system from .NET 1.1 to .NET 4.0. I also had to update the ASP Session State database to version 2 by running the following command in the command window.
aspnet_regsql.exe -S localhostSQL2005 -d ASPState -ssadd -sstype c -E
Is there any way that I can configure the MSI setup project to check the ASP.NET Session State and install version 2 if needed?
On my development machine, the session state data is retained after a post back to the server. (XP VS 2008) (This is true if running from within VS or if running in browser with localhost.)On the deployed test server, the session state is blank in IE, but works in Firefox. (Svr 2003 IIS 6)Both machines are running the exact same code with the exact same imputs and same web.config. There is no code between the post backs that write to the session state.Newest addition to the server would be the consumption of a WCF web service. Could this be a symptom of something missing on the server(s) when trying to connect with WCF? I could not find any information other than installing the 3.0 framework. I have 3.5 SP1 installed on the test server.
View 2 Replies