ID:145886
 
BYOND Version: 344.887

Operating System: Windows 98 Second Edition

Web Browser: Microsoft Internet Explorer 6

Game/Hub(s): http://crashed.faith-gaming.com/cgi-bin/site.dmb

Detailed Problem Description: On my DMCGI website, I've included a "login/logout" link to allow users to login and out. But whenever I click on "login", I get sent to secure.dantom.com and I get the login field, but at the top it says: "Error: unable to complete connecting you to your destination.". But, Holy Retribution got his dmcgi website working fine (http://faith-gaming.com). I really don't know what the problem is.

Code Snippet to Reproduce Problem:
CGI
var/character/char
Topic(href,href_list[])
Load()
World=src
if(usr.ckey!="guest")char=new/character(usr.key)
if(!href){href="page=index"; href_list=params2list(href)}
Parse(href,href_list,src)
Save()

proc
Load()
if(fexists("saves/save.sav"))
var/savefile/F=new("saves/save.sav")
F["pages"]>>pages
else
pages=list()
for(var/i in typesof(/page)-/page)
pages+=new i
Save()

Save()
var/savefile/F=new("saves/save.sav")
F["pages"]<<pages



proc
Parse(href,href_list[],var/CGI/C)
if(href_list["page"])
var
header=getContent(findPage("header"),href)
footer=getContent(findPage("footer"),href)
usr<<browse("[header][getContent(findPage(href_list["page"]),href)][footer]")
else if(href_list["action"])
switch(href_list["action"])
if("login")C.Login("?page=index")
if("logout")C.Logout("?page=index")


Does the problem occur:
Every time? Or how often? Everytime.

On other computers? Yes.

In other user accounts? Yes.
A previous thing happened to me, I believe I had to change http: to https: or something, it's in one of my old posts, if you want, you can do a forum search for flamesage, DMCGI
In response to Flame Sage
I could not find any topics relating to a 'login' or 'logout' problem.
In response to Crashed
Crashed wrote:
>               if("login")C.Login("?page=index")
> if("logout")C.Logout("?page=index")
>


This is your problem. Calling CGI/Login() with an argument sends that argument -- and only that argument -- as the full return url to secure.dantom.com. You are sending only "?page=index" which is not a valid url.

If you call CGI/Login() without an argument, it sends the current url. Otherwise you have to construct the full url you want yourself. In your code, "page=index" is the default, so you can just call Login() and Logout() with no argument.
In response to Mike H
Okay, I took out the arguments in login/logout, and I pin-pointed the problem. When I tried to login, I got Internal Server Errors. So I checked out the site.log, and there I got 3 runtime errors:

"BYOND(344.887) BUG: bad ref (5:0) in DecRefCount
BYOND(344.887) BUG: bad ref (5:0) in DecRefCount
BYOND(344.887) BUG: bad ref (5:0) in DecRefCount"

Is this a BYOND bug, or did I just program something incorrectly/harmfully?