Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old September 13th, 2004, 06:12 AM
Authorized User
Join Date: Sep 2004
Location: Las Pinas, , Philippines.
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to mikersantiago
Default session problems

Hi guys, I just want to consult something and this has been my problem for almost half a year, wheoooo...

Here's the situation, we have an existing intranet application for HRD. It uses session and database login authentication and it is working properly in the existing web server (fyi:I was not the one who developed the application), now I was tasked to transfer the application to another server that will act as the new web server.

Here are the important codes for the initial asp pages:

1. main.asp - has the form action,
<form name="form1" method="post" action="verify.asp">

2. verify.asp - has the db connection and,

id = Request.form("employeeid")
pwd = Request.form("password")
session("employeeid") = id

if id = "" or pwd = "" then
Response.redirect invalid_page
end if

set my_conn= Server.CreateObject("ADODB.Connection")
set rscheck = my_conn.Execute ("Select * from Employee where EmpID='" & id & "' and Password='" & pwd & "'")
if rscheck.eof then
Response.redirect invalid_page
'invalid password and redirect to error.asp

session("employeeid") = rscheck("EmpID")
session("name") = rscheck("NickName")
session("fullname") = rscheck("FirstName") session("password") = rscheck("Password")
'etc session...
end if

Response.redirect "home.asp"
end if

3. home.asp

If session("employeeid") = "" Then
Response.Redirect "mainend.asp"
'Response.Write("Value: " & Session("employeeid"))
End If

Now, I just copied the files in the wwwroot of the specified new web server (main.asp, verify.asp and home.asp, from the old server to the new server since they are the same files and were supposed to work and function alike from the old server to the new server...) and set the configurations in IIS (e.g. session properties), ODBC connections, etc...

All I have to do is to check if it works properly and since I first checked or browsed the web application in internet explorer in the old server, it works! session is working alright (it does shows the session, Value: 6745-3, which is the format of the employee id)... But when i tried checking or browsing the web application in internet explorer in at least 4 other client pc's, session is not working, I'm being redirected to mainend.asp (codes in home.asp - Response.Redirect "mainend.asp"). What makes it worst is that session is not also working when I tried to browse it in internet explorer in the new web server.

It is very confusing since the session is working in the old web server (in internet explorer, as client pc since the files are pointed to the new web server) but it is not working in other pc's and most especially in the new web server.

I've tried configuring the necessary configurations in IIS (application configuration - enable session state), Internet Explorer (cookies setting), global.asa (default codes), but still it is not working (I've read resources and advices from this article from microsoft, http://support.microsoft.com/defaul...kb;EN-US;175662).

Our last resort was to reformat the web server and install default configuration for IIS and others, and to no avail, it's still not working.

I would really appreciate any advice and help since this problem is giving me lots of headaches and I'm in the process of developing other applications with database login authentications using session. What are my options?

Thank you all in advance.

  #2 (permalink)  
Old September 13th, 2004, 08:37 AM
Friend of Wrox
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post

Try this in your new webserver.

1) verify.asp
id = Request.form("employeeid")
pwd = Request.form("password")
session("employeeid") = id
'Add the following code here
Response.write "Session EmployeeId = " & session("employeeid") & "<br>"
Response.write "Form EmployeeId = " & id 
See if that displays the EmployeeId from session there. If so, follow that for every page in sequence, and see where you miss that.


- Vijay G
Strive for Perfection
  #3 (permalink)  
Old September 13th, 2004, 09:07 AM
Friend of Wrox
Join Date: Oct 2003
Location: Cochin, Kerala, India.
Posts: 463
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to madhukp

Here is how you can block session at the server.

1) Open IIS Manager
2) Right-click default web site / your web site
3) Open properties
4) Open home directory tab.
5) You can see a configuration button at the bottom near application name.
6) click configuration button
7) OPen app options (iis 5.0) / options (iis 6.0) tab.
8) uncheck enable session check checkbox.

Session is now disabled for your site.

Check whether this is done for your site. That may be the reason.

Check the box mentioned in 8th step and then restart www publication service. Session is now enabled.

Do this only when the debugging suggested by Vijay does not give you a solution. It is better to keep the default settings of server.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Session Problems in .NET 2.0 ~Bean~ General .NET 0 March 6th, 2006 09:53 AM
Session variable problems fogofogo PHP How-To 3 December 28th, 2005 09:42 AM
Setting Session variables problems hoffmann JSP Basics 0 February 9th, 2005 11:58 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.