Session Variable Value Lost Problem

Hi, i am making a login page, in which after successfull login i am storing mey  CandidateId in session like

Session("CandidateId") =  reader("CanId")

but this above session variable value is lost in other locations... when i redirect to any other page.................. plzz help me out......

note. the above session variable is  availabe to me in the same page......

like Response.write(session.item("CandidateId")) is available in the login.aspx

but not in  successful.aspx................. or any other page...

 

 

 

0
Salmanniaz
5/9/2005 12:31:27 PM
asp.net.web-forms 93655 articles. 6 followers. Follow

8 Replies
447 Views

Similar Articles

[PageSpeed] 40

Are your users being redirected to a secure page to login? Switching between Secure pages and non-secure pages is effectively using two different domains in terms of session variables. Therefore, you cannot add the CandidateId to the session until after you have redirected the user to the non-secure domain. I would suggest passing it through as a query string value (encrypted if necessary) and then pulling it from the URL.

-Bri

0
BriWebGuy
5/9/2005 1:23:12 PM

No.. its not a secure domain... i am using the same method.. in some of other pages but  it is working for me..

the only difference is.. that.. login page and successfull page is at root. but other pages in a seperate directory within a root...

 

but i do not know... why...

some of the time there comes error of  Inherits="applicationname.pageName" at the page level.. as well..

0
Salmanniaz
5/10/2005 3:48:51 AM

I have a similar problem, My problem is I'm opening a javascript pop up window  in the client side and update a session in the C# application. What i have in the popup window is a asp calendar control. When you change the date it gets the date you selected and update the session and close the the popupwindow by calling window.close javascript. Same time it do a submit(); onunload of the popwindow to the parent window. This post backs the parent page and comes with the updated session. But i saw when testing the session value get updated at sometimes but not other times. Any Solution. I also find out this happens when you empty session value after assigning it to a string in parent window in my case which is needed to do. Any body have a solution to work this out

0
ravindranathw
10/19/2005 4:27:04 AM
As you are saying your login page is in root directory & othere are in inner directory. Please check you may have created virtual directory in the root directory & have puted the web.config file in inner directory. This will create a new application in the root application, because of this you are not able to share the session.
Thanks & Regards,
Amit Batra

0
Amit_Boyzone
10/19/2005 6:10:26 AM
 Salmanniaz wrote:

Hi, i am making a login page, in which after successfull login i am storing mey  CandidateId in session like

Session("CandidateId") =  reader("CanId")

but this above session variable value is lost in other locations... when i redirect to any other page.................. plzz help me out......

note. the above session variable is  availabe to me in the same page......

like Response.write(session.item("CandidateId")) is available in the login.aspx

but not in  successful.aspx................. or any other page...



This shoulds like an issue of cookies being disabled. Have you checked this as well?

Nick
0
nick
10/19/2005 1:24:22 PM
This may be as simple as using Response.Redirect when you should use Server.Transfer.

try switching.  
0
ShadyNFWL
10/19/2005 2:05:55 PM
Hi
NO. my cookies are not disabled,
Can u please explain the differene between
Response.redirect       And Server.Transfer

Thanks
Waiting Reply
0
Salmanniaz
10/20/2005 8:15:01 AM
Response.redirect("form name") just sends the user to a new form Server.transfer("form name") will show the new forn but keep all session and global variabes intact.  I used it to solve a problem I had thanks for the reminder.  Ohh PS also add the line Server.transfer("form name", True) directly under the session variable.
0
ShadyNFWL
10/20/2005 12:26:04 PM
Reply:

Similar Artilces:

"link to" problem, Warning: undefined variable session.value[value]
Hi! In my html datawindow,i have made a "link to" In this link, i have a javascript expression, like this: session.value.email If this session has been set, it works just great, But before this value has been set, the html datawindow displays a warning message: vaiable session.value.email has not been set.. How can i go around this? If i use a: if (session.value.email="undefined"; var tempvar1=null; else var tempvar1=session.value.email; Then i use the tempvar1 in my link.. But this make the datawindow go in a serious error and displays a parser erro...

Passing Values from a Web Form to Another Web Form
Hello All! I am trying to pass values from one web form to another web form. I know that there are 3 ways of doing this: queryString, Server.Transfer and Session. I am using the Server.Transfer method. But I am not able to create, in my 2nd web form, an instance of my 1st web form. My 1st Web form is named CallTrack.aspx and my 2nd is named Export.aspx. What I mean is something like this: Public value as CallTrack. I can't create it in my 2nd web form because when the intellisense is displayed, there's no CallTrack in the options. Thanks!   How about using cross-...

Value of variable session problem
Hello, I'm using ASP.net and C# for web development. If I use session variables ( every user connect to the application is identified by a session ). If declare a variable x as follow </P><FONT color=#0000ff size=2> <P>public</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>class</FONT><FONT size=2> GenererReports : System.Web.UI.Page</P> <P>{</P> <P></FONT><FONT color=#0000ff size=2>private</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>string</FONT><...

problem with session variable on a web server
Hi thereI'm having a problem with session variable on a page where I want to keep Datatable var for a shoppingcart. The page looses all its session variabl between postbacks.  How can I get the cart variable accessible without using cookies in the session ???  Is there a new solution for this prob in asp.net 2.0 ???  I don't want each user to have to verify that I´m representing a secure site...   If I use cache variable, then it would be accessible by all user, isn´t it ???  AnneSp Hi, Session state is certainly the correct place for user-specific ...

Session variable value gets lost
I am using asp.net 3.0 with C#. My web application requires some values that is used across my User Controls. These values are pertaining to the login user name and User type. When each user is logged in I store that username and user type in a session variable and whenever i need to used it like in a query I just called the string variable that is assigned to the Session variable. My problem is sometimes my session object/ string variable loses its value and I am wondering is there another way of storing my User's credential so that the value will not be lost until the User closes his/h...

session variables in javascript on a web form
Hi All, I have master page on which I have written a javascript which open ups a new window when user clicks on menu item placed on the left side of master page. The javascript follows  function OpenWind()       {         <% if( HttpContext.Current.Session["Id"]==null) { %>                alert('Session Expired! Redirecting to login page!');           &nb...

Problem storing value other then session variable
Hi All, Whatelse  can i use to store value instead of session variable.Bcoz in my program i am not able to maintain session vairable value. and i want to hide that value from the user also that's why i dont want to use Query String. Is it possible ? Thanks for your answer -Yanku         Cookie is yet another way old method but tried and true and you can expire them immediatly so if they dump the page it goes , you can also secure them to your site as well.  All things will come back to you, either good or bad.Come rant with me....Http://www.cit...

Implementing .Net Form into an APS.net web form, can this be done
I am new here, but have been searching for a while, and may not have the correct lingo to find what I am looking for.  I am tasked with implementing a .exe application that was writen vb6 then converted to .net into a new website my team is developing. The idea is to put each of the 3 different forms in this .exe application of 3 different .aspx pages. I have attempted multiple things to get this into the page and even started to just rewrite it as an ASP.net web form, but even then I can't reuse any of the code since the System.Web.UI.Page doesn't inherit the sa...

Forms Authentication w/ Session variables
I am used forms-based authentication and session variables. The problem I'm having is the fact that occassionally, my session times-out or is terminated and a new one starts. Since the user is already authenticated, they don't need to log back in - but their session variables are all destroyed. What should I do: a.) Instead of using Session variables - add that info. to my authentication ticket? If so, can someone give me an example of how to add: Stree_Name, House_Number to my authentication ticket for use throughout the site b.) Can I add something to to top of each page that ...

RETURN a Session value in a web form. HELP!!
I am able to store and return a session value for response.write on a destination webpage form. However I am unable to return this as a (value) to pull a specific record. To help explain myself! I would like to return a record to the datagrid below... that matches a Session Value instead of the entered Textbox Value as in the sample below. <%@ Page Language="VB" %> <script runat="server"> ' Insert page code here ' Function GetCustomerByCustomerID(ByVal customerID As Integer) As System.Data.SqlClient.SqlDataReader ...

Session variables not pointing to Request.Form Values
I am trying to take the value a user inputs from a form and put it into a session variable.  The basic code (on Page1) is thus:Session("first_name") = Request.Form("first_name")If I reference the session variable on that same page (such as <%= Session("first_name") %>) it works fine.   However, when I go to a new page (Page2) it does not work anymore, the session variable just shows up blank.  If I go back to the first page and set the session variable equal to a simple string it works and will show up fine on both pages.  Like thu...

Problems with the .NET 2005 web form designer
In Visual Studio.NET 2003, building a web page was very similar to building a plain old form. In 2005, everything's changed. Every control gets shifted to the top left, I have to use panels and so on to separate things, and if I have to change something later it's an absolute nightmare. Am I really stuck with this, or is there some switch somewhere that will allow me to do things the way I'm used to?   Geoffrey Callaghan Try this.  Bring up an aspx page in design (not source) mode.  This will enable the Layout menu. Goto Layout->Position->Auto-Pos...

Problem in Passing controls values between web forms
Hi friends          i have problem with my .aspx application inwhich i want to store the values of controls in a webform to the variables in the other one.         My application is like, i have a mainpage in which i have an <IFRAME>, into which i call other 3 .aspx pages one by one using links. Now i wants to save the values of controls in those all three child page in my mainpage variables and from that i want to store them in database.        Please help me ou...

passing values to .net web form application
Hi Can any explain me abt how to pass values to my .NET web form application (designed using PB 11.1) from other web application? My intension is to redirect from a web application (ASP.NET to .net web form application) to my web application with user information. Thanks & Regards, Anbazhagan From the "Deploying Applications and Components to .NET" manual: >>> Starting an application with command line parameters If your application requires command line parameters, you can assign values to the PBCommandParm global property before you deploy the...

Web resources about - Session Variable Value Lost Problem - asp.net.web-forms

Variable - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Westpac interest rate rise is one of many variable loan rate rises
WESTPAC is not alone in hitting its owner-occupier customers with a surprise interest rate rise, as dozens of other variable rate home loans ...

Airbnb upgrades variable pricing tool for hosts
Online home rental group Airbnb is rolling out an upgraded variable pricing tool that automatically raises or cuts room rates based on supply ...

Commonwealth Bank raises variable home loan rates
Home owners' mortgage costs are set to rise by hundreds of dollars a year, after the Commonwealth Bank became the latest bank to hike interest ...

CBA lifts variable home loan rates to offset costs associated with stricter capital requirements
The Commonwealth Bank to lift its home loan interest rates independently of the Reserve Bank to partially offset costs associated with stricter ...

Washington Square Signs Spielbergs, Choi Joins Variable and More
... films and an episode of the HBO comedy series "Girls," on which he plays the role of Ray Ploshansky. New York-based creative collective Variable ...

YouTube v10.32 Tweaks Some Interface Elements And Includes Hints About Virtual Reality Content And Variable ...
Forget Update Wednesday! Monday is the new big day. Not only were we treated to the latest M preview release and the official Marshmallow name, ...

"You have to ignore many variables to think women are paid less than men. California is happy to try." ...
Writes Sarah Ketterer in The Wall Street Journal in "The ‘Wage Gap’ Myth That Won’t Die" (which you can get to without subscribing if you Google ...

Staley: 'A lot of different variables...been a hard year'
... 41° Navigation Home Giants A's Sharks Warriors Kings 49ers Raiders Quakes Insiders More Tickets Shop Watch Staley: 'A lot of different variables...been ...

Expert Reveals the Latest Variable Capacity Technology
Learn about gForce Ultra CRAC equipment, the latest variable capacity technology to lower energy usage and increase reliability.

Resources last updated: 1/20/2016 9:40:24 AM