UserID
Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums
Forum Description: Support forum for Web Wiz Forums application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=25712
Printed Date: 03 April 2026 at 4:05pm Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com
Topic: UserID
Posted By: true_king
Subject: UserID
Date Posted: 12 May 2008 at 9:36pm
i'm using
function chatter(w,h) { var winl = (screen.width - w) / 2; var wint = (screen.height - h) / 2; var lstr = "ChatRoom/chatroom.asp?txtUsername="& strLoggedInUsername &", 'ChatWindow2', 'toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0,width=700,height=460,top='+wint+',left='+winl" window.open(lstr) }
to open a chat window, where strLoggedInUsername is webwiz logedin username but not working.........
anyway, which string use as username in forum?
|
Replies:
Posted By: WebWiz-Bruce
Date Posted: 13 May 2008 at 8:39am
Try:-
txtUsername=<% = strLoggedInUsername %>",
As the variable you are calling is a server side ASP variable and not available client side
------------- https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting
|
Posted By: true_king
Date Posted: 13 May 2008 at 11:03am
Ya it working... i'm using aspchatnow to make a chatbox.... i'm using this,
ChatRoom/chatroom.asp?txtUsername=King
but no one in right panel of active userlist..... but if i do it from default.asp(aspchatnow) and enter a name it open a new popup window with same url,
ChatRoom/chatroom.asp?txtUsername=King
but it working how?
|
Posted By: true_king
Date Posted: 13 May 2008 at 11:50am
i'm using this,
<form> <p align="center"> <input type=button href="#" value="Open ChatZone" name="Chatter" OnClick="chatter(709,481);" </p> <SCRIPT LANGUAGE="javascript"> function chatter(w,h) { try { var winl = (screen.width - w) / 2; var wint = (screen.height - h) / 2; var username = '<%= strLoggedInUsername%>'; if(username=='Guest') { alert("You Must Login In Order To Use This Feature."); } else { window.open('ChatRoom/ChatRoom.asp?txtUsername='+username, 'ChatWindow2', 'toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0,width=700,height=460,top='+wint+',left='+winl)} } catch(e) { alert("Unable To Open Chat Window, Maybe Pop-Ups Are Blocked."); } } </SCRIPT> </form>
but itz not secure from client any idea?
|
Posted By: WebWiz-Bruce
Date Posted: 13 May 2008 at 12:02pm
The only way to make it truly secure is to pass the username across server side.
You may be able to modify web wiz forums and ASPchatNow to both use session variables to pass across the username.
------------- https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting
|
Posted By: true_king
Date Posted: 13 May 2008 at 12:57pm
ok if i sending session variable from web wiz forums to aspchatnow..... how aspchatnow got it?
i know asp.net methode,
session.add("") session.item.add("")
what is it in asp?
btw is session can be hack using javascript injection?
|
Posted By: WebWiz-Bruce
Date Posted: 13 May 2008 at 1:00pm
Sessions are server side so can not be affected by client side javascript as session varaibles are stored on the server and are not passed across to the clients browser.
To set a session is ASP use:-
Session("Username") = strLoggedInUsername
And to read in back in use:-
strLoggedInUsername = Session("Username")
------------- https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting
|
Posted By: true_king
Date Posted: 13 May 2008 at 1:02pm
|
also i need to clear session during log off.... how do this in webwiz or when clicking close button of aspchatnow...(let i put code session remove when click onto log out button of aspchatnow, but if user click on close button then?)
|
Posted By: WebWiz-Bruce
Date Posted: 13 May 2008 at 1:36pm
You would use:-
Session.Contents.Remove("Username")
------------- https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting
|
Posted By: true_king
Date Posted: 13 May 2008 at 1:47pm
|
but how to remove session when user clcik onto close button(mean xp red cross that in popup window....)
|
Posted By: WebWiz-Bruce
Date Posted: 13 May 2008 at 2:09pm
Simple, you can't, however the session variable will be removed after 20 minutes of inactivity, unless you have set the session timeout to be higher.
The following page gives more details on ASP sessions:-
http://www.w3schools.com/ASP/asp_sessions.asp
------------- https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting
|
Posted By: true_king
Date Posted: 13 May 2008 at 8:51pm
thanks.... and how to make session from a button click and session function will be in server script...
also the button will call 2 methode session one and other one that will call popup(its a javascript.......)
cause i don't know what is vb code of ,
var winl = (screen.width - w) / 2; var wint = (screen.height - h) / 2;
can u tell me?
|
|