Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to stay in the same Session??

Status
Not open for further replies.

jsteph

Technical User
Oct 24, 2002
2,562
US
Hi,
I'm trying to use session variables to deal with certain things that a user may type in to the 'home' page of a particular site.

He selects from several dropdowns, and these values are stored in session variables.

Now, throughout the site there are different .asp pages, which present html to the user. The question is--how do I ensure that each .asp page is part of the same Session as the first login?? This is beyond frustrating. Some pages are called via javascript's window.open (using the _self paramter, which I'd assume is the same window, and same session), and some are called by doing response.Redirect.

Is one of those methods the 'wrong' way? Is there a clearly defined way to call a new .asp page and have it be guaranteed that it's within the same session as the page which called it? All pages are in the same server, domain, site, application, etc, etc.

If not, then what would be the usefulness of a session variable?
Thanks,
--Jim
 
This may help you

Can I use session variables if the user does not have cookies enabled? faq333-2381

General FAQ faq333-2924
5 steps to asking a question faq333-3811
 
onpnt,
That faq was elightening. I've always had cookies enabled, so the isssue I'm having seems to be in how I'm calling the pages. I haven't figured it out yet, but there seems to be a difference if, for example, in Page1 I call:

response.redirect "page2.asp"
--- OR ---
response.redirect "
The page comes up fine both ways, but it appears (though it's gone both ways now so I'm even more confused) that the second way starts a new session, and the first way seems to assume the same session.

As I said, it worked fine (ie, same session) the second way at least once, so it may not be consistent.
--Jim
 
that doesn't have anything to do with your session state that I can recall.

speaking of which, do you have session state enabled on the server

General FAQ faq333-2924
5 steps to asking a question faq333-3811
 
Yes, session state is checked, with a timeout of 60, and none of my code is altering the timeout.

But now, I can't even make it break--I'm trying to call my different pages and testing as I was before--with the session.sessionid against a request variable that is the sessionid of the caller.

And now they're always the same--which is of course good--but earlier they were coming up different.

I'll keep trying to 'break' it, because I really want to know what to avoid...
--Jim
 
because I really want to know what to avoid

Sessions all together ;)



General FAQ faq333-2924
5 steps to asking a question faq333-3811
 
Doh, I just answered the other post without realizing there was already a more extensive posting on the same subject...argh

 
tarwn,
Yes...I'd just replied to the other one...thanks.

BTW...I'm not nitpicking but it caught my eye...is the 'too easily create...' in your sig graphic intentionally using the 'too' instead of 'to'?
--Jim
 
If by intentional you mean "Tarwn should have paid more attention in grammar class", than yes ;)

And 5 seconds with an FTP browser will fix it, it's that easy ;)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top