session problem

This is a discussion on "session problem" within the Classic ASP section. This forum, and the thread "session problem are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices




Closed Thread
 
LinkBack Thread Tools
  #1  
Old May 9th, 2005, 06:25
New Member
Join Date: May 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
session problem

Hi all,

I been bothered by this problem for very long time and i hope maybe some of you can help me out. Thanks in advance.

My company website have this problem that it cannot remember the session for those user who use firefox. To make thing simple, i wrote somthing like this:

Code: Select all
<html>
<body>
<% 
Response.Cookies("SSDC")("User_ID") = 1234
session("test1") = "firefox"
session("name") = "wee"
session("enrol_id") = 654321

%>

link
</body>
</html>
The code above will set a normal cookies as well as set some session variables. And also a hyperlink to the second page as below:

Code: Select all
<html>
<body>


Browser is <%=session("test1") %> </p>


Name is <%=session("name") %> </p>


enrol is <%=session("enrol_id") %> </p>


cookies is <%=request.cookies("SSDC")("User_ID") %> </p>

</body>
</html>
So, supposingly when the user click the hyperlink to the second page, The second page should display all the values set in the first page. But this only true for internet explorer but not firefox. And more interesting is when i comment away the response.cookies in the first page, all the session variables can be captured.

You can try to access this pages by following this link

www.ssdcl.com.sg/sessionTest1.asp

I also sure that firefox is set to accept cookies.

Any help is appreciated. Thanks again and sorry for my poor english.


Regards,

fender79
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!

  #2  
Old May 9th, 2005, 09:23
Reputable Member
Join Date: Aug 2003
Location: United Kingdom
Posts: 341
Thanks: 0
Thanked 0 Times in 0 Posts
Sometimes I find that I have to set a session value twice in a row to get it to actually set correctly:

Code: Select all
session("test1") = "firefox"
session("test1") = "firefox"
Although I suspect this might not be the root of your problem.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #3  
Old May 10th, 2005, 00:19
New Member
Join Date: May 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Hi,

I try to set the session variables twice but still not successful.
The thing i cannot understand is why when i comment away the response.cookies, the session variables will work. But if i not, it wont work at all.

Rgs,
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #4  
Old May 10th, 2005, 00:53
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
I assume you've tried setting the cookie after the session variables?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #5  
Old May 10th, 2005, 01:00
New Member
Join Date: May 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
ya i did that also but also cannot work.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #6  
Old May 10th, 2005, 12:04
Highly Reputable Member
Join Date: Jul 2003
Location: Ipswich, UK
Posts: 690
Thanks: 0
Thanked 0 Times in 0 Posts
Try setting the cookies and session varibles BEFORE your opening <html> tag...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #7  
Old May 11th, 2005, 00:18
New Member
Join Date: May 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
I try to put the asp code before the opening of html tag but still cannot work. Is there any server setting will affect this?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #8  
Old May 17th, 2005, 11:50
Up'n'Coming Member
Join Date: Feb 2004
Location: Woodbridge, UK
Age: 27
Posts: 80
Thanks: 0
Thanked 0 Times in 0 Posts
Have you tried outputting Session.SessionID - Does it work?

Are you using IIS?

I have tried almost exactly the same code on my machine and it works, but like you say, if I try your link in FF it doesn't work.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #9  
Old May 18th, 2005, 02:26
New Member
Join Date: May 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
HI,

I put this code in sessiontest2.asp



session id is <%=session.sessionID %> </p>

and i found that the session id is not the same each time i refresh the browser. How can this be?

Ya, using IIS.

Rgs,
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Closed Thread

Tags
session, problem

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Session *not your usual* problem ysamu PHP Forum 0 Mar 28th, 2008 10:00
[SOLVED] Session data problem longstand PHP Forum 15 Dec 9th, 2007 18:28
Session Timeout problem LameesAyman ASP.NET Forum 2 May 2nd, 2007 14:45
Generating ID or Session Problem? Options chlad Classic ASP 2 Aug 21st, 2006 11:47
problem with Session variable andrew_perez5 Classic ASP 0 Jan 24th, 2005 03:42


All times are GMT. The time now is 04:24.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42