473,406 Members | 2,843 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

find logged in user using javascript

Hi Team,
Can i find the logged in user using javascript? can someone please share the code for the same?
Jun 5 '09 #1
10 3117
Dormilich
8,658 Expert Mod 8TB
that depends on how you log in the user. if it's server side, you probably need to do an AJAX request. if you put the username in a cookie, you should get that without problems.
Jun 5 '09 #2
Hi Dormilich,

I will explain you my problem.
I am having one app which is uploading doc using .net's impersonation functionality and using \\<path>. the code is working fine as everything is on the same .cs file. Now when i am trying to open the saved document i am using the same impersonation functionality and logging in with same user. but i am getting error while opening the doc it is asking me username/pwd which is not happening for uploading.
code for opening the doc is on .js file and using http://<path> to read the file.
Jun 5 '09 #3
Dormilich
8,658 Expert Mod 8TB
why do you open the file using javascript?

you can pass login details along with the url:
Expand|Select|Wrap|Line Numbers
  1. http://login:password@domain.tld
Jun 5 '09 #4
Hi,
Can you please help me on how to pass the service account's username and password with the url? After that will server stop opening the prompt to enter uname and password?
my path is like this
http://abc.abc.abc.abc/test/<path of the file>
how to append uname pwd with this?
Jun 5 '09 #5
Dormilich
8,658 Expert Mod 8TB
see code above (add login:password@ before the host name/address)
Jun 5 '09 #6
Hi,
I am not that good in js so do i have to write the domain name also?
e.g.
http://<uname_xyz>:<pwd_abc>@<server_name>/<file path>
Where to write the domain name there?
we have diff domains name for diff regions
e.g em,apj,am
Jun 5 '09 #7
Dormilich
8,658 Expert Mod 8TB
@pallavsheth
yes

@pallavsheth
you write it where you do the request.
Jun 5 '09 #8
Hi,
Thanks for quick reply.
I tried to embade username, pwd with the url but it is not opening. Giving error.


http://UNAME:PWD@abc.def.lmn.com/TES...23456/test.xls

I got invalid syntax error. Page can't be displayed.
Jun 5 '09 #9
Dormilich
8,658 Expert Mod 8TB
hm, no idea. though it works with my own server.

does it work when you put that in your browser's address bar?
Jun 5 '09 #10
Hi,
No it is giving me error. First i tried to test it with browser only.
I just added username and pwd with the url.
Jun 5 '09 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: fig000 | last post by:
Hi, I'm relatively new to Javascript so please bear with me on what might sound like silly questions. This is what I want to do: I'm working in classic asp (I have to for this project). I...
9
by: CW | last post by:
I wrote an HTML based chat application. The front end is built entirely on HTML + javascript. Essentially, I have a hidden frame that's refreshed frequently and any new messages are displayed in...
1
by: Leszek | last post by:
Hi I have user-side javascript that validates a form. And I have server-side php script thad does the same. Is it possible to disable php script from showing messages about missing values if...
2
by: Jake Barnes | last post by:
Using javascript closures to create singletons to ensure the survival of a reference to an HTML block when removeChild() may remove the last reference to the block and thus destory the block is...
5
by: mvr | last post by:
Hi all How to get the Windows current logged user name using Classic ASP. If no direct way are there any work arounds. Thanks mvr
0
by: dsartain | last post by:
Hi, I'm trying to use C++.NET to find which user is currently logged in. This is part of a bigger project for which I'll also need to retrieve visited URL's from the web browser as well...but one...
2
by: simon.wilkinson | last post by:
Hi, I am trying to update all Select boxes on a page dynamically using javascript, I simple want to change the selected item in each select box when a tick box is pressed on the page. Each...
3
by: Nathan Sokalski | last post by:
After a user has logged in using the Login controls, how do I get the information for that user (such as username, password, email) for use in code? -- Nathan Sokalski njsokalski@hotmail.com...
1
by: shakthi712 | last post by:
hi friends I am developing a chat application here i have kept general chat room here multi users can chat with each other but now i want one to one chat in my application, when logged user click...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.