Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: availibility of session variables


Message #1 by "andrew steiger" <andrewsteiger@y...> on Mon, 11 Mar 2002 19:52:09
I am setting a session variable in an .aspx file and then doing a 

redirect.  I can see the value in the page it is being set on after it is 

being set through debug mode, but once I redirect from that page, the 

value is not set.  Any ideas?
Message #2 by "Garland Frye" <gfrye@s...> on Mon, 11 Mar 2002 14:51:45 -0600
If you show me your Response statements(the one for getting to the page you

are setting the session values, and one you are using to go to the page

where you are using attempting to use them). I'm quite sure I know what your

problem is...



Thanks,

Garland



"andrew steiger" <andrewsteiger@y...> wrote in message

news:155415@a...

>

> I am setting a session variable in an .aspx file and then doing a

> redirect.  I can see the value in the page it is being set on after it is

> being set through debug mode, but once I redirect from that page, the

> value is not set.  Any ideas?

>

>





Message #3 by "Andrew Steiger" <andrewsteiger@y...> on Mon, 11 Mar 2002 20:52:53 -0500
This is a multi-part message in MIME format.



------=_NextPart_000_0174_01C1C93E.B6C23220

Content-Type: text/plain;

	charset="iso-8859-1"

Content-Transfer-Encoding: quoted-printable



Setting Session Variable:



protected void cmdAction_Click(object sender, System.EventArgs e) {



    this.bValidUser =3D 

this.validUser(this.txtUserName.Text,this.txtPassword.Text);





    Session.Contents.Add("loggedin",this.bValidUser.ToString());





    if (!this.ValidLogin) {



        lblError.Visible =3D true;



    } else {



        this.Page.Response.Redirect(this.RedirectionURL,true);



    }



}



Calling Session Variable:

protected bool UserLoggedIn {

get {



    try {



           return 

Session["loggedin"].ToString().ToLower().Equals("true");



    } catch (Exception ex) {



        return false;



    }



}



}



----- Original Message -----

From: "Garland Frye" <gfrye@s...>

Newsgroups: aspx

To: "ASP+" <aspx@p...>

Sent: Monday, March 11, 2002 3:51 PM

Subject: [aspx] Re: availibility of session variables





> If you show me your Response statements(the one for getting to the 

page you

> are setting the session values, and one you are using to go to the 

page

> where you are using attempting to use them). I'm quite sure I know 

what your

> problem is...

>

> Thanks,

> Garland

>

> "andrew steiger" <andrewsteiger@y...> wrote in message

> news:155415@a...

> >

> > I am setting a session variable in an .aspx file and then doing a

> > redirect.  I can see the value in the page it is being set on after 

it is

> > being set through debug mode, but once I redirect from that page, 

the

> > value is not set.  Any ideas?

> >

> >

>

>

>




>












_________________________________________________________



Do You Yahoo!?



Get your free @yahoo.com address at http://mail.yahoo.com







Message #4 by "Garland Frye" <gfrye@s...> on Tue, 12 Mar 2002 11:38:31 -0600
This is a multi-part message in MIME format.



------=_NextPart_000_0009_01C1C9BA.6F55F990

Content-Type: text/plain;

	charset="iso-8859-1"

Content-Transfer-Encoding: quoted-printable



This is not enough information to do anything other than speculate. 

However my guess is this... The server names that you are using to 

Redirect to a fully qualified URL are not the same. i.e.

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

=3D=3D=3D=3D=3D=3D=3D=3D=3D

Response.Redirect("http://MyServer" + Request.ApplicationPath + 

"/Form.aspx"



(Session variable will be stored at MyServer)



is not the same as



Response.Redirect("http://localhost" + Request.ApplicationPath + 

"Form.aspx"



Session variable will be stored at localhost

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

=3D=3D=3D=3D=3D=3D=3D=3D=3D



ASP.NET considers two seperate server names as two different servers, 

even if both names pertain to the same server(as is the case with 

localhost vs. servername).



Another thing that can cause Session loss is Virus Scan software running 

on the server.



I hope all of this helps you out...





Thanks,

Garland R. Frye



  "Andrew Steiger" <andrewsteiger@y...> wrote in message 

news:155507@a...

  Setting Session Variable:



  protected void cmdAction_Click(object sender, System.EventArgs e) {



      this.bValidUser =3D 

this.validUser(this.txtUserName.Text,this.txtPassword.Text);





      Session.Contents.Add("loggedin",this.bValidUser.ToString());





      if (!this.ValidLogin) {



          lblError.Visible =3D true;



      } else {



          this.Page.Response.Redirect(this.RedirectionURL,true);



      }



  }



  Calling Session Variable:

  protected bool UserLoggedIn {

  get {



      try {



             return 

Session["loggedin"].ToString().ToLower().Equals("true");



      } catch (Exception ex) {



          return false;



      }



  }



  }



  ----- Original Message -----

  From: "Garland Frye" <gfrye@s...>

  Newsgroups: aspx

  To: "ASP+" <aspx@p...>

  Sent: Monday, March 11, 2002 3:51 PM

  Subject: [aspx] Re: availibility of session variables





  > If you show me your Response statements(the one for getting to the 

page you

  > are setting the session values, and one you are using to go to the 

page

  > where you are using attempting to use them). I'm quite sure I know 

what your

  > problem is...

  >

  > Thanks,

  > Garland

  >

  > "andrew steiger" <andrewsteiger@y...> wrote in message

  > news:155415@a...

  > >

  > > I am setting a session variable in an .aspx file and then doing a

  > > redirect.  I can see the value in the page it is being set on 

after it is

  > > being set through debug mode, but once I redirect from that page, 

the

  > > value is not set.  Any ideas?

  > >

  > >

  >

  >

  >




  >






Message #5 by Andrew Steiger <andrewsteiger@y...> on Tue, 12 Mar 2002 09:50:02 -0800 (PST)
--0-152908737-1015955402=:42931

Content-Type: text/plain; charset=us-ascii





 thanks, I will check it out...apprieciate all the help

  Garland Frye <gfrye@s...> wrote: This is not enough information to do anything other than speculate. However my guess
is this... The server names that you are using to Redirect to a fully qualified URL are not the same.
i.e.===========================================================Response.Redirect("http://MyServer" + Request.ApplicationPath +
"/Form.aspx" (Session variable will be stored at MyServer) is not the same as Response.Redirect("http://localhost" +
Request.ApplicationPath + "Form.aspx" Session variable will be stored at
localhost=========================================================== ASP.NET considers two seperate server names as two different
servers, even if both names pertain to the same server(as is the case with localhost vs. servername).  Another thing that can cause
Session loss is Virus Scan software running on the server.  I hope all of this helps you out...   Thanks,Garland R. Frye "Andrew
Steiger" <andrewsteiger@y...> wrote in message news:155507@a... Session Variable: 

protected void cmdAction_Click(object sender, System.EventArgs e) {



    this.bValidUser = this.validUser(this.txtUserName.Text,this.txtPassword.Text);







    Session.Contents.Add("loggedin",this.bValidUser.ToString());







    if (!this.ValidLogin) {



        lblError.Visible = true; 



    } else {



        this.Page.Response.Redirect(this.RedirectionURL,true);



    }



}

Calling Session Variable:protected bool UserLoggedIn {

get {



    try {



           return Session["loggedin"].ToString().ToLower().Equals("true");



    } catch (Exception ex) {



        return false;



    }



}



}

----- Original Message ----- From: "Garland Frye" <gfrye@s...>Newsgroups: aspxTo: "ASP+" <aspx@p...>Sent:
Monday, March 11, 2002 3:51 PMSubject: [aspx] Re: availibility of session variables

> If you show me your Response statements(the one for getting to the page you

> are setting the session values, and one you are using to go to the page

> where you are using attempting to use them). I'm quite sure I know what your

> problem is...

> 

> Thanks,

> Garland

> 

> "andrew steiger" <andrewsteiger@y...> wrote in message

> news:155415@a...

> >

> > I am setting a session variable in an .aspx file and then doing a

> > redirect.  I can see the value in the page it is being set on after it is

> > being set through debug mode, but once I redirect from that page, the

> > value is not set.  Any ideas?

> >

> >

> 

> 

> 











---------------------------------

Do You Yahoo!?

Try FREE Yahoo! Mail - the world's greatest free email!


Message #6 by Andrew Steiger <andrewsteiger@y...> on Tue, 12 Mar 2002 09:52:03 -0800 (PST)
--0-1559445135-1015955523=:90169

Content-Type: text/plain; charset=us-ascii





 I was wondering though, I am using relative pathing, so should this matter.

  Garland Frye <gfrye@s...> wrote: This is not enough information to do anything other than speculate. However my guess
is this... The server names that you are using to Redirect to a fully qualified URL are not the same.
i.e.===========================================================Response.Redirect("http://MyServer" + Request.ApplicationPath +
"/Form.aspx" (Session variable will be stored at MyServer) is not the same as Response.Redirect("http://localhost" +
Request.ApplicationPath + "Form.aspx" Session variable will be stored at
localhost=========================================================== ASP.NET considers two seperate server names as two different
servers, even if both names pertain to the same server(as is the case with localhost vs. servername).  Another thing that can cause
Session loss is Virus Scan software running on the server.  I hope all of this helps you out...   Thanks,Garland R. Frye "Andrew
Steiger" <andrewsteiger@y...> wrote in message news:155507@a... Session Variable: 

protected void cmdAction_Click(object sender, System.EventArgs e) {



    this.bValidUser = this.validUser(this.txtUserName.Text,this.txtPassword.Text);







    Session.Contents.Add("loggedin",this.bValidUser.ToString());







    if (!this.ValidLogin) {



        lblError.Visible = true; 



    } else {



        this.Page.Response.Redirect(this.RedirectionURL,true);



    }



}

Calling Session Variable:protected bool UserLoggedIn {

get {



    try {



           return Session["loggedin"].ToString().ToLower().Equals("true");



    } catch (Exception ex) {



        return false;



    }



}



}

----- Original Message ----- From: "Garland Frye" <gfrye@s...>Newsgroups: aspxTo: "ASP+" <aspx@p...>Sent:
Monday, March 11, 2002 3:51 PMSubject: [aspx] Re: availibility of session variables

> If you show me your Response statements(the one for getting to the page you

> are setting the session values, and one you are using to go to the page

> where you are using attempting to use them). I'm quite sure I know what your

> problem is...

> 

> Thanks,

> Garland

> 

> "andrew steiger" <andrewsteiger@y...> wrote in message

> news:155415@a...

> >

> > I am setting a session variable in an .aspx file and then doing a

> > redirect.  I can see the value in the page it is being set on after it is

> > being set through debug mode, but once I redirect from that page, the

> > value is not set.  Any ideas?

> >

> >

> 

> 

> 











---------------------------------

Do You Yahoo!?

Try FREE Yahoo! Mail - the world's greatest free email!


Message #7 by "Lewis Bass" <lewis@t...> on Wed, 13 Mar 2002 08:23:09 -0700
This is a multi-part message in MIME format.



------=_NextPart_000_001E_01C1CA68.4F3DBC20

Content-Type: text/plain;

	charset="iso-8859-1"

Content-Transfer-Encoding: quoted-printable



If the url is on your current site you can gain speed by using

server.transfer( url )



the response.redirect sends the url to the browser and relys on the 

browser to redirect



the server.transfer does it on the server - but restricts the movement 

to the current website





  ----- Original Message -----

  From: Andrew Steiger

  To: ASP+

  Sent: Tuesday, March 12, 2002 10:52 AM

  Subject: [aspx] Re: availibility of session variables





  I was wondering though, I am using relative pathing, so should this 

matter.



    Garland Frye <gfrye@s...> wrote:



    This is not enough information to do anything other than speculate. 

However my guess is this... The server names that you are using to 

Redirect to a fully qualified URL are not the same. i.e.

    

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

=3D=3D=3D=3D=3D=3D=3D=3D=3D

    Response.Redirect("http://MyServer" + Request.ApplicationPath + 

"/Form.aspx"



    (Session variable will be stored at MyServer)



    is not the same as



    Response.Redirect("http://localhost" + Request.ApplicationPath + 

"Form.aspx"



    Session variable will be stored at localhost

    

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

=3D=3D=3D=3D=3D=3D=3D=3D=3D



    ASP.NET considers two seperate server names as two different 

servers, even if both names pertain to the same server(as is the case 

with localhost vs. servername).



    Another thing that can cause Session loss is Virus Scan software 

running on the server.



    I hope all of this helps you out...





    Thanks,

    Garland R. Frye



      "Andrew Steiger" <andrewsteiger@y...> wrote in message 

news:155507@a...

      Setting Session Variable:



      protected void cmdAction_Click(object sender, System.EventArgs e) 

{



          this.bValidUser =3D 

this.validUser(this.txtUserName.Text,this.txtPassword.Text);





          Session.Contents.Add("loggedin",this.bValidUser.ToString());





          if (!this.ValidLogin) {



              lblError.Visible =3D true;



          } else {



              this.Page.Response.Redirect(this.RedirectionURL,true);



          }



      }



      Calling Session Variable:

      protected bool UserLoggedIn {

      get {



          try {



                 return 

Session["loggedin"].ToString().ToLower().Equals("true");



          } catch (Exception ex) {



              return false;



          }



      }



      }



      ----- Original Message -----

      From: "Garland Frye" <gfrye@s...>

      Newsgroups: aspx

      To: "ASP+" <aspx@p...>

      Sent: Monday, March 11, 2002 3:51 PM

      Subject: [aspx] Re: availibility of session variables





      > If you show me your Response statements(the one for getting to 

the page you

      > are setting the session values, and one you are using to go to 

the page

      > where you are using attempting to use them). I'm quite sure I 

know what your

      > problem is...

      >

      > Thanks,

      > Garland

      >

      > "andrew steiger" <andrewsteiger@y...> wrote in message

      > news:155415@a...

      > >

      > > I am setting a session variable in an .aspx file and then 

doing a

      > > redirect.  I can see the value in the page it is being set on 

after it is

      > > being set through debug mode, but once I redirect from that 

page, the

      > > value is not set.  Any ideas?

      > >

      > >

      >

      >

      >




$subst('Email.Unsub').

      >




$subst('Email.Unsub').









-------------------------------------------------------------------------

-----

  Do You Yahoo!?

  Try FREE Yahoo! Mail - the world's greatest free email! --- Change 

your mail options at http://p2p.wrox.com/manager.asp or to unsubscribe 

send a blank email to $subst('Email.Unsub').







  Return to Index