473,387 Members | 1,575 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

new session created when changing pages

I have a set of pages with C# code attached to manage session information.
They hang their info off of the session string and store it in a MSDE table.
I have all of this code working well in one app and started another app which
needed much of the same functionality. So I copied the pages, code behinds,
web.config and appropriate DB tables to the new app (all on localhost) and
find that I am get redirected every time I login back to my login because
..IsNewSession always comes up true on the page after the login.

Just in case I messed something up, I went back and checked my old pages and
found that they were behaving fine. I double checked that the login was happy
and creating the DB information, and it is. Asp.Net / IIS seems to just be
creating a new session for every page I load in this second app.

I am hoping that someone has a couple of pointers to save me having to take
this app apart. I'm figuring I missed a setting somewhere, and I am pretty
new at Asp.Net (I had been doing CGI and / or PHP up til 2004).

TIA for any input!

Robb Sadler
Nov 19 '05 #1
1 1433
OK, I have found a clue... I decided to try and add some info into the
session data itself and so put in the line:

System.Web.HttpContext.Current.Session.Add("zot", "zot");

to add some information to the session when I first came upon it. I don't
know why in my previous app I did not need to do this but in the current one
it now returns with the same session when going to a new page (or refreshing
the same one, etc).

Is the session class assuming that I didn't use it since it's data had
nothing added to it?

At this point I have enough info to continue, but would love to get any
comments.

Thanks!

Robb

"MrGiga (Robb Sadler)" wrote:
I have a set of pages with C# code attached to manage session information.
They hang their info off of the session string and store it in a MSDE table.
I have all of this code working well in one app and started another app which
needed much of the same functionality. So I copied the pages, code behinds,
web.config and appropriate DB tables to the new app (all on localhost) and
find that I am get redirected every time I login back to my login because
.IsNewSession always comes up true on the page after the login.

Just in case I messed something up, I went back and checked my old pages and
found that they were behaving fine. I double checked that the login was happy
and creating the DB information, and it is. Asp.Net / IIS seems to just be
creating a new session for every page I load in this second app.

I am hoping that someone has a couple of pointers to save me having to take
this app apart. I'm figuring I missed a setting somewhere, and I am pretty
new at Asp.Net (I had been doing CGI and / or PHP up til 2004).

TIA for any input!

Robb Sadler

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

27
by: mrbog | last post by:
Tell me if my assertion is wrong here: The only way to prevent session hijacking is to NEVER store authentication information (such as name/password) in the session. Well, to never authenticate...
10
by: Bob Bedford | last post by:
In the attempt to keep the URL and code quite clean, and avoid to have a very loooong url, we have used $_session for storing values trough the pages. Now, we have some clients that doesn't get...
1
by: Werner | last post by:
Hi Patrick! Can you give an example of how to use a frameset inside an aspx-file? When I create a new frameset in Visual Studio.Net it just gives me a htm-File. Or give me a link where I can...
1
by: Adil Akram | last post by:
I have created a site shopping cart in ASP.net. I am using ASP session object's SessionID on non SSL connection to track session. While adding products to cart DB I insert product and SessionID...
1
by: Wiktor Zychla | last post by:
Hello there, I've just encountered a strange problem with Session. In one particular scenario it is cleared between pages but the scenario is so specific that I am really, really startled. I've...
5
by: George | last post by:
Hi, Is it possible to delay session creation in ASP.NET I want the user to browse my site without any session created (no cookies set). My pages will know that is Session = null then Session has...
7
by: Bill | last post by:
I've noticed that in my ASP application that session variables are not carried over from one IE6 open browser window to another. Can anyone tell me how IE can do this? It seems like it's a useful...
5
by: TRB_NV | last post by:
I'm losing information from my Session when I change pages or start the same page over again. I simplified the code so the example is really clear. The sample code that follows is supposed to...
2
by: Gordon Burditt | last post by:
I had this idea about preventing session fixation, and I'm wondering what anyone else thinks about it. The idea is, essentially, don't allow session ids that YOUR PHP didn't generate (and aren't...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.