VS 2008 Managing Session Myself
Mar 13, 2011
I am creating a web page that will pretty much persist - no postbacks - using jQuery.
I'm going to talk to the page with web services.
So I was thinking that when the user first gets the webpage I give them a GUID that they have to pass back to me with every future call to web services.
I'll simply save the GUID in a table in my MS SQL database and by grabbing that record from the db I could potentially get all my user specific data - user id - permission levels - whatever.
I can make the session row expire after like 10 hours - or something like that - so that they don't get the same session tomorrow simply by forgetting to close the browser window at the end of the work day.
..
View 2 Replies
Similar Messages:
May 26, 2010
I am sorry if this is been discussed earlier. I am having a problem maintaining the session when someone uses the same browser with multiple tab, the results gets messed up. A perfect example would be, [URL] if you open IE (or any other browser) and open two tabs and search for two different air travel itinerary and the results will completely overlapped (real mess). I know the cause for this problem (both tabs uses the same session). I would appreciate if somebody have any solution for this. I am using ASP.NET 3.5/VS 2008/VB.NETI will not be able to use Viewstate since I use a master page and pre-init event where view state is not available.
View 2 Replies
Dec 13, 2010
I want to fetch a web page from a ASP.NET site that is only accessible from within a session. I'm using Apache HttpClient. I first open the main page of the site, then I search for the link to the "goal" page, and then I fire up a GET request for the "goal" page. The problem is that when I get the response for the second GET request, I always get the same (first) page. If I open the site with Firefox or Google Chrome I get the "goal" page.
From the first response from the server I get the following headers:
HTTP/1.1 200 OK
Date: Sun, 12 Dec 2010 19:03:56 GMT
Server: Microsoft-IIS/6.0
Platform: Mobitel Pla.NET
Node: 4
X-Powered-By: ASP.NET
X-AspNet-Version: 1.1.4322
Set-Cookie: ASP.NET_SessionId=0vpgd055cifko3mnw4nkuimz; path=/
Cache-Control: no-cache, must-revalidate
Content-Type: text/html; charset=utf-8
Content-Length: 7032
I inspected the traffic with WireShark and all headers look OK. I send the correct cookie back to the server on the second GET request.
I'm using Apache HttpClient. I have only one instance of DefaultHttpClient and I reuse that for the second request. I have BROWSER_COMPATIBILITY Cookie Policy.
View 2 Replies
Apr 22, 2010
i have two applications hosted on two different domains and both use a single login info so my question is how can i use / share same session across two application.
View 8 Replies
Jul 12, 2010
I restored a database from another server, and everything looks good except the users.
I'm managing all this from SQL Server 2008 Management Studio as SA.
The users are present in the [u]databaseName > security > users[/u] section, and they exist in [u]databaseServer > Security > Logins[/u]. However I can't change anything in the [u]databaseName > security > users[/u] section, because when I try and make a change, and then I hit OK to apply, it says "[i]login name must be specified[b][/b][/i]". But the login name field is grayed out and I can't modify it(even though I'm logged into the machine as Administrator and SQL as SA).
Also, in the user mapping section, when I try to map one of the users to a database, it says '[i]create failed user already exists[b][/b][/i]'...but I don't want to create the user, I just want to map that user to the appropriate databases...
View 2 Replies
Apr 22, 2010
I want to increase the session time,By default the session will expire in 20 minutes,I want that session will expire in 1 Hour,Hw to to dat?
View 11 Replies
Jun 10, 2010
I have a situation where my session variables seem to get corrupted. I Page_Load I am calling 2 subs. Each of them fills a GridView with data from a table. I am saving the content of each Data.DataTable into Session Variables:
Get_Summary_Last_Completed_Shift()
code in sub:
mySqlDataAdapter.Fill(mySqlDataTable)
Session("mySqlDataTable1") = mySqlDataTable
GridView1.DataSource = mySqlDataTable
GridView1.DataBind()
Code:
Get_Petroleum_Disbursement()
code in sub:
mySqlDataAdapter.Fill(mySqlDataTable)
Session("mySqlDataTable5") = mySqlDataTable
GridView5.DataSource = mySqlDataTable
GridView5.DataBind()
After I call the 1st sub and I debug the session variable "mySqlDataTable1" contains all the data from the table. After I call the 2nd sub and I debug the session variable "mySqlDataTable1" has been changed and contains a mix of data from the 2 tables.
View 2 Replies
Jul 18, 2010
how can I check on the server side how much time is left before the session times out?
View 2 Replies
Mar 17, 2011
Using VS2008 .Net 2.0 ASP.Net I'm using a singleton class to store user info on my ASP website.I was wondering - will this class be subject to session expiry? [eg] If the user logs in and I save a successful login as 'true' in a boolean property for the instance of the class, will this value expire after the session times out?
View 3 Replies
Jun 16, 2010
Can you use a session variable in a web config connection string? So instead of:
Code:
<add name="ConnectionString2" connectionString="Data Source=ora;Persist Security Info=True;User ID=SA;Password=PASS;Unicode=True"
something like this:
Code:
<add name="ConnectionString2" connectionString="Data Source=" & Session(DB) & ";Persist Security Info=True;User ID=SPAR;Password=;Unicode=True"
View 6 Replies
Mar 25, 2011
I need to save data in a datatable on a web page where the user is adding items to order. I know how to create a datatable and add data to it. And I will be binding it to a gridview control. But I do not want to loose the data when the page does a postback. Do I need to save it to a session variable for this? Or will the data stay in the datatable?
I found this code posted online. Is this how I would save it to a session variable and then load it anytime?
Code:
Dim dt As New DataTable()
Session("MyDataTable") = dt
' To retrieve it from session
Dim dt As DataTable = DirectCast(Session("MyDataTable"), DataTable)
View 1 Replies
Mar 30, 2010
Usually using Visual Studio's debugger is a breeze. Scanning through Locals quickly shows the values of variables, etc. However, I'm at a loss how to find out the values contained in session state variables? Can anyone give me a hand?Lets say I put a breakpoint right after:
Session("first_name") = "Rob Roy"
How do I view the value contained in Session("first_name") from locals?
View 2 Replies
Nov 9, 2010
I need to store viewstate in session to optimize my page performance on postback.
I am developing ASP.Net Website, using Visual Studio 2008.
I created a class named "BasePage" under "App_Code".
[Code]....
Now, I know if I inherit this class in all of my pages, that will work but I am looking to do this through Config file.
Is there any way that I can write something in Config file to use this class for all the pages?
so that if I want to remove, I can simply remove from config file and I do not need to compile my whole project again.
View 4 Replies
Apr 22, 2010
I've half written an app which has just one model for adding and editing a particular entity.I am trying to embrace modelmetadata and where possible reduce my form code to just calls for EditorForModel. One of the key issues I am having it managing the
differences between a add and update scenario.
Take "User" editing for example, in an Add scenario I want "Password" to be a required field, in an update scenario I dont' want it to be a required field. The model-centric approach would have me create two models, one for adding and one for editing. My
edit model wouldn't have the Required attribute on the Password field. My feeling is this is going to create a bit too much plumbing.
Besides having a rather massive amount of automapping going on there is another more irrititating issue. Strongly typed views. I could... maybe see my way to having a different model for create and edit, using inheritance i could.. maybe mitigate the amount of code required. What I can't abide is having to have two seperate views, as I have already coding myself into a wall with strongly typed views I couldn't share add and edit (based on my understanding) scenarios with one view.
So anyway I was wondering what other peoplle are doing to manage this? Working with an outsourced (Indian) developers it would be great to make use of EditorForModel as I want them writing as little code as possible.
View 14 Replies
Nov 1, 2010
I have to use cache multiple forms data that will be submitted on last form. I m not getting how to handle cache key as it should be unique. I want to use this key to get and put data in different forms. I considered to use GUID but it is very long to put in query string.
View 2 Replies
Aug 11, 2010
Currently we are using WebFormsMVP to allow better testability in our project. The framework does presenter binding in OnInitComplete and relies heavily on DataBind expressions e.g.
<asp:Label Text="<%#Model.FirstName%>" runat="server" />
As i understand above article this would put Model.FirstName into ViewState. Because databinding happens late during page lifecycle when viewstate tracking is already enabled.
One option would be to disable ViewState altogether. Are there any other? Remeber, we can't use OnInit or OnInitComplete, because OnLoad is the first event presenters can handle.
View 1 Replies
Apr 4, 2010
There have been many question on managing EntityContext lifetime, e.g. http://stackoverflow.com/questions/813457/instantiating-a-context-in-linq-to-entitiesI've come to the conclusion that the entity context should be considered a unit-of-work and therefore not reused. But while doing some research for speeding up my database access, I ran into this blog post...Improving Entity Framework PerformanceThe post argues that EFs poor performance compared to other frameworks is often due to the EntityConnection object being created each time a new EntityContext object is needed.
To test this I manually created a static EntityConnection in Global.asax.cs Application_Start().
I then converted all my context using statements to
using( MyObjContext currContext = new MyObjeContext(globalStaticEFConnection)
{
....
}
This seems to have sped things up a bit without any errors so far as far as I can tell.But is this safe?Does using a applicationwide static EntityConnection introduce race conditions?
View 3 Replies
Jan 13, 2011
I am getting "ASP.NET Session Expired" error when viewing SQL Server 2008 reports using the Microsoft ReportViewer web control. I found this article http://balanagaraj.wordpress.com/2009/09/25/session-has-expired-in-asp-net/ which suggests to use one worker process in IIS application pool, but that may affect performance, is there any other solution for this? I tried setting "AsyncRendering" to false already and that didn't work.
View 2 Replies
Apr 28, 2010
First, I'm running my application on my local Win 7 box, and viewing the site on the same box.
I have several session variables set while interacting with my application. When I go to check the data in the database through the Database Explorer (Show Table Data), my session is lost. This is instant.
Why does this happen? Is there a way to prevent it?
View 1 Replies
Apr 19, 2010
I am part of a development team building a new ASP.NET 3.5 web application. Two of us are C# coders, and the other is a VB.NET coder.
I know that we can mix languages on a per-project basis, and one can build classes in one language that inherit from classes written in the other language in a different project (which we are already doing), but I can see us getting into a situation where we might well end up with cyclic dependencies between our various project DLLs.
Other than simply having a high number of projects (more seperation of concerns into more libraries), how have you managed this situation on your own projects?
Note - I believe this question to be different enough from the only similar match I could find (this one) on the basis that we are not wanting to use different languages in order to take advantage of their specific features per se, but rather to make use of what developer resource is available to us (i.e. one dev just happens to be VB.NET only).
View 3 Replies
May 28, 2010
With VS2010's mandate that web.config be included in the project, how do we allow everyone to keep their own custom config file without getting into source control problems?
Previously, we would simply leave web.config out of our project, allowing everyone to keep their own local version of web.config on their machine. We moved to VS2010, and it is now forcing me to add web.config to my project in order to run debug mode. Because our project is linked to TFS, it automatically adds web.config to source control and tries to maintain it that way.Is there a way to run in debug mode without including web.config in your project? Or is there a better way to manage config files?
View 6 Replies
Feb 8, 2011
I'm having an issue with my hosting provider (winhost.com). My app is built on ASP.NET 4 MVC 3. Up until a few days ago, everything was running fine. All of a sudden I've started getting 503 errors when trying to access my site (wikipediamaze.com). It doesn't happen all the time, just most of the time.
When someone starts playing the game a request is made to wikipedia.org to get the contents of the page for the current step in the puzzle. Basically I'm screen scraping wikipedia.org, injecting some html and then displaying the results. All of my web requests are closed immediately after receiving the data.
What winhost is telling me is that there are connections remaining open and causing any additional requests to the site to get the 503 Service Unavailable Error. What I can see from my end is that only 1 request is ever allowed to be made to wikipediamaze.com at a time. If you keep refreshing the page you'll eventually get the HTML but all subsequent requests (css,images,js) all get the 503 error. Even pages that don't ever call out to wikipedia.org.
If it was an issue with connection throttling in IIS, do both incoming and outgoing (requests made internally) fall in to the same bucket? If I'm sure all of my connections are being closed (and I've never had this issue before) what else could cause this?
View 1 Replies
Dec 1, 2010
how I can create a Database in SQL Express, then add tables and columns .. etc to the Database.
On PHP & MySQL I use to go into PhpMyAdmin and do that all there ! However with SQL Server Express and Visual Studio 2010. how to do it.
View 3 Replies
May 27, 2010
Say I have this entity with a lot of attributes. In the input form I have decided to implement a wizard control so I can collect information about this entity in several steps. The problem is that I need to collect information that has been modeled has many to many relationships. I am planning to use a telerik gridview to manage this (add/edit/delete), the problem is where do I store that data since the entity in a insert form is not created on the database yet. OK so I can store all that info in temporary lists residing in the viewstate, waiting for the final submit where I dump all that in the DB, but one of the steps I am collecting files...now storing files in the viewstate is out of the question, same as as storing them in the session...I have been thinking of implementing in a way that the user has to submit some info first (say first 3 steps), commit the data to the database creating the parent entity and then start inserting all the childs entities...but this will get weird as it's confusing since on the first steps you not saving the data to the DB and on the next ones you are commiting directly...
View 1 Replies
Mar 31, 2011
I've put my site online and I'm looking to add/change user membership. From Visual Studio, I can access the Website Administration Tool WSAT and it's great if you just want to add users manually. Is there a similar way to change users once the site is hosted on a remote server?For the moment, I change the user information through the WSAT and re-FTP the mdf file; it's pretty painful.
View 1 Replies