Click to See Complete Forum and Search --> : Losing Session


jrthor2
07-11-2003, 01:57 PM
I have a login page that if you login with admin, you can add/update/delete users. All of a sudden, it is not working. when you ligin, you get the list of all the users and their info. When you select Add/Update/delete, I am getting a blank page all of a sudden. Not sure why. I have attached my code, as it is too long to paste.

In the view source for my page, it gets up to the line that reads <div align="center">, right before all the asp code (line 30 in my editor)

Thanks

Ribeyed
07-12-2003, 01:06 PM
HI,
can read the file you posted for some reason its all on 5 lines. Can you just zip all the files as well as the include files and attach the zip.

jrthor2
07-12-2003, 08:19 PM
Sure, here are all the files used in the Admin part of my site for administering the database of users.

Ribeyed
07-12-2003, 09:13 PM
Hi,
one thing i noticed straight away was line 35 in aspccConfig.asp. You have the following:


If objRS("URL") <> "" Then
Response.Redirect objRS("URL")
line35: Session("Admin") = strUsername
Else
Response.Redirect objRS("HTML")
End If

we line 35 will never run, therefore the strUsername is never been written to the session. Try this:


If objRS("URL") <> "" Then
Session("Admin") = strUsername
Response.Redirect objRS("URL")

Else
Response.Redirect objRS("HTML")
End If

Hope this helps

jrthor2
07-13-2003, 11:30 AM
Nope, didn't make a difference.

Ribeyed
07-13-2003, 11:57 AM
Hi,

Nope, didn't make a difference.


Well it would, but is not the only problem you must have. As i said before the line never runs the ray you have it coded. I will have another look at your code to see if i can see anything else, however can you check to make sure you have IIS configured correctly to allow sessions.

jrthor2
07-13-2003, 12:43 PM
I don't run my own server, but I know IIS is set up correctly, because I use this same login/database on a different section of my website. I believe the problem started when I started using sessions for this admin portion of my website.

Ribeyed
07-13-2003, 12:51 PM
Hi,
ok so the next step would be to try and track down where the session is not working. Can you modify your code to response.write the session variable out to screen after every line that writes a value to the session. For example: you have this following line:


session("Admin") = strUserName


so you would add this:


response.write "The session value is = " & session("Admin")


run your code and make sure that the value is being stored.

jrthor2
07-14-2003, 08:05 AM
Ok, I put in the response.write code, but I had to put it on the aspccAdmin page, because the aspccConfig script redirects you to that page. It prints:

The session value is = 1

Which is correct, but when I click on Add/Edit/Delete, the session value is blank

jrthor2
07-16-2003, 11:12 AM
Can anyone help here? Even if I hit the refresh button, my session variable goes to nothing????

I've included a zip file that has all my updated pages in it.

Thanks

jrthor2
07-22-2003, 08:33 AM
Can anyone help with this????