sniper
11-23-2005, 10:01 AM
I have to find a way to pass this through the querystring.
On one page:
strUniqueId = CreateSessionId(strUserId,1,0)
On the other page:
call CheckSessionId(strUniqueId,1)
The problem is that the value is getting set but it's not being received on the other page. Because of this my login is appearing as invlaid although it is. This is not my code, so all I know is what I see. Please help!!
Thank you.
sniper
11-23-2005, 10:39 AM
Someone please make sense of this.
function CreateSessionId(intUserID,bitLoginStatus,bitLoginCapture)
dim procSessionIDNewForUserID 'Hold the Session id
'aller dans DB si user existe
set procSessionIDNewForUserID = server.CreateObject("ADODB.Command")
set procSessionIDNewForUserID.ActiveConnection = ConnBoutique
procSessionIDNewForUserID.CommandText = "procSessionIDNewForUserID"
procSessionIDNewForUserID.CommandType = adCmdStoredProc
procSessionIDNewForUserID.Parameters.Append procSessionIDNewForUserID.CreateParameter("@UserID", adchar, adParamInput, 9, intUserID)
procSessionIDNewForUserID.Parameters.Append procSessionIDNewForUserID.CreateParameter("@ProgramSource",adChar, adParamInput,5,Application("strProgramSource"))
procSessionIDNewForUserID.Parameters.Append procSessionIDNewForUserID.CreateParameter("@LoginStatus", adInteger, adParamInput,4,bitLoginStatus)
procSessionIDNewForUserID.Parameters.Append procSessionIDNewForUserID.CreateParameter("@LoginCapture", adInteger, adParamInput,4,bitLoginCapture)
procSessionIDNewForUserID.Parameters.Append procSessionIDNewForUserID.CreateParameter("outuserUniqueId", adGUID,adParamOutput)
procSessionIDNewForUserID.Execute
CreateSessionId = procSessionIDNewForUserID.Parameters("outuserUniqueId").value
set procSessionIDNewForUserID = nothing
end function 'CreateSessionId
sub CheckSessionId(strUniqueId,byLogstat)
dim procUserIDForSessionID
dim intIDOfUser 'User Id for the user
dim StautOfSession
if Trim(strUniqueId) = "" then
Response.Redirect "http://" & Application("strServerURL")
end If
'aller dans DB si user existe
set procUserIDForSessionID = server.CreateObject("ADODB.Command")
set procUserIDForSessionID.ActiveConnection = ConnBoutique
procUserIDForSessionID.CommandText = "procUserIDForSessionID"
procUserIDForSessionID.CommandType = adCmdStoredProc
procUserIDForSessionID.Parameters.Append procUserIDForSessionID.CreateParameter("userUniqueId", adGUID, adParamInput, 16, strUniqueId)
procUserIDForSessionID.Parameters.Append procUserIDForSessionID.CreateParameter("Logstat", adBoolean, adParamInput, 1,byLogstat)
procUserIDForSessionID.Parameters.Append procUserIDForSessionID.CreateParameter("outputuserId", adChar, adParamOutput,9)
procUserIDForSessionID.Parameters.Append procUserIDForSessionID.CreateParameter("outputProgramSource", adChar, adParamOutput,5)
procUserIDForSessionID.Parameters.Append procUserIDForSessionID.CreateParameter("outStautOfSession", adInteger, adParamOutput)
procUserIDForSessionID.Execute
intIDOfUser = procUserIDForSessionID.Parameters("outputuserId").value
StautOfSession = procUserIDForSessionID.Parameters("outStautOfSession").value
if StautOfSession = 0 then
'get site info
dim blnLoginCapture
dim strBuyerCookie
set procUserIDForSessionID = server.CreateObject("ADODB.Command")
set procUserIDForSessionID.ActiveConnection = ConnBoutique
procUserIDForSessionID.CommandText = "procUserIDForSessionIDExpired"
procUserIDForSessionID.CommandType = adCmdStoredProc
procUserIDForSessionID.Parameters.Append procUserIDForSessionID.CreateParameter("userUniqueId", adGUID, adParamInput, 16, strUniqueId)
procUserIDForSessionID.Parameters.Append procUserIDForSessionID.CreateParameter("outputuserId", adChar, adParamOutput,9)
procUserIDForSessionID.Parameters.Append procUserIDForSessionID.CreateParameter("outputProgramSource", adChar, adParamOutput,5)
procUserIDForSessionID.Parameters.Append procUserIDForSessionID.CreateParameter("LogCapture", adBoolean, adParamOutput, 1)
procUserIDForSessionID.Parameters.Append procUserIDForSessionID.CreateParameter("buyerCookie", adVarChar, adParamOutput, 50)
procUserIDForSessionID.Parameters.Append procUserIDForSessionID.CreateParameter("outStautOfSession", adInteger, adParamOutput)
procUserIDForSessionID.Execute
intIDOfUser = procUserIDForSessionID.Parameters("outputuserId").value
blnLoginCapture = procUserIDForSessionID.Parameters("LogCapture").value
strBuyerCookie = Trim(procUserIDForSessionID.Parameters("buyerCookie").value)
StautOfSession = procUserIDForSessionID.Parameters("outStautOfSession").value
'redirect to sessionPage
if StautOfSession = 0 then
Response.Redirect "http://" & Application("strServerURL")
else
Response.Redirect "http://" & Application("strServerURL") & "/SessionsExpired.asp?LoginCapture=" & blnLoginCapture & "&BuyerCookie=" & strBuyerCookie
end if
else
strUserId= trim(intIDOfUser)
end if
set procUserIDForSessionID = nothing
end sub 'CheckSessionId
silverbullet24
11-23-2005, 01:29 PM
i'm not seeing where the session id is actually being stored in a session
what about adding this
strUniqueId = CreateSessionId(strUserId,1,0)
session("mysessionid") = strUniqueId
then on the page that checks for it
if Trim(session("mysessionid")) = "" then
Response.Redirect "http://" & Application("strServerURL")
end If
sniper
11-23-2005, 01:36 PM
You're right. I noticed that myself. Thank you for your help.