...

View Full Version : Session Variables...IE V FireFox



jammy
01-11-2007, 10:43 PM
I'm really hoping someone out there is able to help or has at least come across this issue as its driving me nuts.

I have a very basic form which sets a session variable dependant on the outcome of an event.

When I write the Session variable to the screen after each event the variable is correct. When I use IE, as soon as the page re-directs to the next page the session variable is for some magical reason lost.

BUT, and this is the annoying bit...if I run the same process in FireFox, the session variable is retained and the re-directed page works as expected...

What on earth is all that about ???? I dont think it is a code issue but maybe something of a system or browser setting issue but I cant work it out for love nor money....Any ideas or suggestions will be greatfully welcomed...

Many Thanks In Advance...

ess
01-12-2007, 01:19 AM
You should check your IE settings....and establish if cookies are enabled or not.

By default, when you start a session, a cookie is created on the client computer containing the session ID. Without this cookie, the server will have no way to knowing who is who.

To overcome this problem, you can always inform your users that they must accept cookies from your website, otherwise it won't work as expected.

Another trick is to include your session id with every url and then read the url with every request. for example,


<a href="http://your_site.com/about.php?SSID=12121009palk1212">about us</a>

Good luck.
Ess

CFMaBiSmAd
01-12-2007, 01:28 AM
Is there a chance that you are switching/redirecting between http and https pages?

jammy
01-12-2007, 11:40 AM
All seems fine with cookies being enabled and what not.

Its also passing to another http page so no change in security or anything like that...

Very frustrating...

jammy
01-12-2007, 03:11 PM
Just for reference, the code which sets the session variable is below :

If rs_Login.EOF AND rs_Login.EOF THEN
Session("Username") = "error"
Session("Admin_Access") = 1
Response.Redirect ("index.asp")
Else
Session("Username") = rs_Login("Username")
Session("User_ID") = rs_Login("user_ID")
Session("Admin_Access") = rs_Login("Access_Rights")
Dim strUserID
strUserID = rs_Login("User_ID")


rs_Login.Close
Set rs_Login = Nothing

Response.Write " CORRECT USERNAME : " & Session("Username") & "<br>"
Response.Write " ADMIN ACCESS : " & Session("Admin_Access") & "<br>"
Response.Redirect ("index.asp")

End If

jammy
01-15-2007, 03:47 PM
I guess know one has come across this before then ????

jammy
01-21-2007, 06:10 PM
OK....been looking in to this further...and still having problems...

What I have noticed though, is that if I register a new user ( e.g write some data to the tbluser table ) and then try and login to the system if all works fine...

Anyone got any suggestions as to how to solve this ???? Its really bugging me now and cant find anyone that is able to help or even make suggestions...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum