.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
MarieAdela
Imran Ghani
Post New Web Links

Session Lost when Debugging

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :ASP.Net
 

I recently upgraded from Vista running VS2008 to Windows 7 running 2010.

Previously, my code ran fine both:

    - debugging from within VS2008

    - running as localhost on local IIS

Now, my code still runs fine on localhost via my PC's local IIS, but when I try to
debug from within VS2010 the Session Variables are lost within a couple of clicks.

The first page is a login screen, so I tried using Response.Redirect("~/home.aspx", false)
to preserve the session state but to no avail.

I have also tried removing all underscores from session variable names with no luck.
I believe the site is running in InProc mode based upon my observations within IIS,
though this is not explicitly set within the web.config

I can only assume that VS2010 somehow runs in its own application pool or environment
that needs a setting changed but have no idea what to try next.

Any help GREATLY appreciated!




View Complete Post


More Related Resource Links

session lost problem

  

hi there,

i have an application that uses sessions.

i have set at the web.config: 

<forms loginUrl="Default.aspx" protection="All" timeout="30" name=".ASPXFAUTH" path="/" requireSSL="false" slidingExpiration="true" defaultUrl="Default.aspx" cookieless="UseCookies" enableCrossAppRedirects="true"/>

and at the global.asax.vb

Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
        Session.Timeout = 30

end Sub

and at default.aspx.vb

Protected Sub LoginButton_Click(ByVal sender As Object, ByVal e As EventArgs)
        Session("userName") = Login1.UserName
        Session.Timeout = 30 ' minutes of session '

    End Sub

At a local iis on windows xp works fine,

but when i publish it at the webserver i am redirected to the default page after about 30 sec!!!

any ideas?

thanks


Changing aspx page causes session data to be lost...

  

Strange but true. Any ideas what might be causing this?

Mike 


Session lost while redirecting

  

Hi,

I have two sites desigined on ASP.net MVC 2 pattern.

I want to redirect from one site to another with the help of Redirect(url) action result. My problem is that I am able to redirect to other site but my session gets lost. Is there any way by which I can retain the session value?

My constraints are I cannot use the sql membership provider, cookies and querystrings

Please help!Frown

Regards,

Deepti



Session variable lost when using hostname in url (IE)

  

Hi experts,

I'm learning asp.net mvc 2, it's very excting with me.

I has built a small MVC2 application, it is working fine in built it ASP.net Development Server. However, there're something wrong when have it deployed in IIS 7.5, Window Server 2008 R2 Enterprise. Session is awlays null when I access the application by IE and use hostname to specify the url.

Using IE (IE 7 or IE8) to access my application with link http://localhost/ or http://<my ip address>/     => every working fine

But when I use IE (IE 7 or IE8) to access my application with link http:/hostname/    => session always null

I'm supprised while FireFox working fine in all cases, both of built in ASP.net Development Server and IIS server, both cases hostname and ip and localhost.

I really appreciate your advise!

Thanks


Session lost when access MVC website by hostname likes http://mypcname/ using IE

  

Hi experts,

I'm learning asp.net mvc 2, it's very excting with me.

I has built a small MVC2 application, it is working fine in built it ASP.net Development Server. However, there're something wrong when have it deployed in IIS 7.5, Window Server 2008 R2 Enterprise. Session is awlays null when I access the application by IE and use hostname to specify the url.

Using IE (IE 7 or IE8) to access my application with link http://localhost/ or http://<my ip address>/     => every working fine

But when I use IE (IE 7 or IE8) to access my application with link http:/hostname/    => session always null

I'm supprised while FireFox working fine in all cases, both of built in ASP.net Development Server and IIS server, both cases hostname and ip and localhost.

I really appreciate your advise!

Thanks



Session Lost Even SQL Server State

  

Good luck to everyone.

Imagine A project has been in the medium-sized scale contents classes in the sessions,

the SQL Server sessions seriliazed. 300-minute session in the state here;

but it losts when they dont till 300 minutes.

there are a lot of solution on the Internet, but most are guaranteed by SQL Server State and it cant be change anything.
 
in the meantime i havent any vps or vds just using low hosting packet web farm or web garden dont know.

by the way i had try another solution named "Defibilator" think a iframe on page and refresh every 60 second for extends session timeout. [didnt work either]

 
Do you think the problem is ?

 

 easy to come to you.

 

p.s : sorry for my bad english


Session variables value lost between pages

  

Hello,

          I am using Session ID Manager in all the pages of the website, but I am losing session variables in between the pages. what should I do to save the values of session variables.


Thank you

Regards

Anoop


MS SQL Server: Disconnect Users From Database - Kill User Session

  
If you ever wanted to restore your database from a SQL backup file (.bak), but there are still users connected to your database, the backup operation will fail causing the error: Exclusive access could not be obtained because the database is in use.

VS2010 Professional .NET 4.0 Remote Debugging ASP Website Project

  

Trying to remote debug ASP website from VS2010 Pro to Windows Server 2003 machine.  Specifically, trying to debug a Web Service, but breakpoint says, "The breakpoint will not currently be hit. No symbols have been loaded for this document."  This happens for all compiled code though.  I have read this is due to missing PDB files and the work around is to manually copy them, as noted here.  Problem is, I cannot find any PDB files for my project, except referenced libraries, which I can remote debug.

Verified

  • web.config has <compilation debug="true">
  • Debugger is attached to wewp.exe process on remote server
  • Installed VS2010 remote debugger from DVD (as I can remote debug referenced libraries)

This is beyond frustrating.  I migrated my code from VS2008 .Net3.5 to VS2010 .Net4.0 to take advantage of the inherent multithreading framework.  Debugging works when using local host and was stable until deployment to test server.

Thanks in advance,

Anthony


SQL Server Session state problem.

  

Hi to all,


I have some things that I want to know. I am right now using a free asp.net webhosting ("somee.com"). The problem is that when I am visiting a page, there's a tendency that values stored in my session variables are lost. Therefore, it causes an error when the requested page is loaded.

1. I am thinking of using sessionState mode="SqlServer". Will it solve my problem?

Actualy Im working on it but Im having problems when connecting to the sql database.

2.  Is that a problem in the webhost?

3. Do free webhosting sites provide allow session state in the sql server?. Because ive tried it locally into my computer and error say's i should intall the ASP.NET Session State SQL Server version 2.0 or above.




Session and Application Variables

  

I have a web application in which i need to logout the user if he clicks the logout button or even if he closes his browser window. On Logout button click, i am doing session.Abandon(), but how to go about his browser window close.

Can anybody help with a code sample.


Is there any way to find out the reason for session expiry?

  

Dear All,

is there any way to find out the reason for session expiry?

Regards

Denny


Session time out earlyer with in 5 min.

  

In my live site session time out with in 5 min only.how can i get the default i.e 20 min time . below webconfig file give below



<?xml version="1.0"?>
<!--
    Note: As an alternative to hand editing this file you can use the
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in
    machine.config.comments usually located in
    \Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
    <configSections>
        <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, &#xA;        System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, &#xA;        PublicKeyToken=31bf3856ad364e35">
            <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, &#xA;        System.Web.Extensions, Ver

Datatable in session

  

I am creating a simple shopping cart using a datatable that is passed into a session object.  I have a small mini cart that displays the total number of items in the cart as well as the running total - this is displayed in a web control.  When the web control starts up I run a try/catch to see if the session object exists, if it doesn't I create the datatable for the cart and store it in the session.  I then have a datalist control that contains all the information for my products including an "add to cart" button.  When the page loads everything looks fine.  If I click on an "add to cart" button nothing happens to the session information.  If I click on it again, the session information updates - displaying only one item is in the cart and then counts up correctly there after.  Additionally, after adding an item, if I select a different item in the list, the same issue occurs.  I am not sure why this is happeing, if anyone can give me an idea I would appreciate it. 


Session

  

Hi friends

I m facing a problem in my application with server so it needs changes .

My question is

Q1.Where should I store my session if i want to disconnect my server or How shold we storesession in web farm if specific serever is shut down.

Q2.Can anyone explain me difference between WEB FARM and WEB GARDEN

 

Regards

Chandrakant

 

 


Session Timeouts

  

What are the issues (if any) of setting sessions to expire after an extended period of time as in 4-8 hours? I'm building an intranet app which is designed so that users will access it once in the morning and then leave it used, possibly, for hours at a time. I'm assuming that there aren't too many since

1) we're running it on a intranet
2) sessions are soley to retain state between requests
3) its not like a connection to the DB where you can conceivable run out


holding datatable value using session

  

Hi,

iam insert record using datable in gridivew,iam using  session to hold the record,

there is any other way to hold the record in datable.

dtempty.Columns.Add("storeid");   
        dtempty.Columns.Add("ratetypeid");
        dtempty.Columns.Add("ratedesc");
        dtempty.Columns.Add("slabs");   
        dtempty.Columns.Add("days");
        dtempty.Columns.Add("rate");
        dtempty.Columns.Add("contid");
        dtempty.Columns.Add("continertype");

        DataRow row;
        row = dtempty.NewRow();
         
        row["ratetypeid"] = ddlratetype.SelectedValue;
        row["ratedesc"] = ddlratetype.SelectedItem.Text;
        row["slabs"] = ddlslabs.SelectedValue;   
 &n

Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend